-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'merchant_beta' of github.corp.magento.com:magento-spart…
…a/magento2ce into MDVA-3
- Loading branch information
Showing
13 changed files
with
706 additions
and
388 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
app/code/Magento/User/Test/Unit/Model/Plugin/AuthorizationRoleTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
/** | ||
* Copyright © 2015 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\User\Test\Unit\Model\Plugin; | ||
|
||
/** | ||
* Test class for \Magento\User\Model\Plugin\AuthorizationRole testing | ||
*/ | ||
class AuthorizationRoleTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** @var \Magento\User\Model\Plugin\AuthorizationRole */ | ||
protected $model; | ||
|
||
/** @var \Magento\User\Model\Resource\User|\PHPUnit_Framework_MockObject_MockObject */ | ||
protected $userResourceModelMock; | ||
|
||
/** @var \Magento\Authorization\Model\Role|\PHPUnit_Framework_MockObject_MockObject */ | ||
protected $roleMock; | ||
|
||
/** | ||
* Set required values | ||
*/ | ||
protected function setUp() | ||
{ | ||
$this->userResourceModelMock = $this->getMockBuilder('Magento\User\Model\Resource\User') | ||
->disableOriginalConstructor() | ||
->setMethods([]) | ||
->getMock(); | ||
|
||
$this->roleMock = $this->getMockBuilder('Magento\Authorization\Model\Role') | ||
->disableOriginalConstructor() | ||
->setMethods([]) | ||
->getMock(); | ||
|
||
$objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); | ||
$this->model = $objectManager->getObject( | ||
'Magento\User\Model\Plugin\AuthorizationRole', | ||
[ | ||
'userResourceModel' => $this->userResourceModelMock | ||
] | ||
); | ||
} | ||
|
||
public function testAfterSave() | ||
{ | ||
$this->userResourceModelMock->expects($this->once())->method('updateRoleUsersAcl')->with($this->roleMock); | ||
$this->assertInstanceOf( | ||
'\Magento\Authorization\Model\Role', | ||
$this->model->afterSave($this->roleMock, $this->roleMock) | ||
); | ||
} | ||
} |
Oops, something went wrong.