-
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 pull request #499 from magento-fearless-kiwis/MAGETWO-59676
Sync 2.0.11 with 2.0-develop
- Loading branch information
Showing
213 changed files
with
7,847 additions
and
1,331 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
53 changes: 53 additions & 0 deletions
53
app/code/Magento/Backend/Test/Unit/Block/Store/SwitcherTest.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,53 @@ | ||
<?php | ||
/** | ||
* Copyright © 2016 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\Backend\Test\Unit\Block\Store; | ||
|
||
class SwitcherTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* @var \Magento\Backend\Block\Store\Switcher | ||
*/ | ||
private $switcherBlock; | ||
|
||
private $storeManagerMock; | ||
|
||
protected function setUp() | ||
{ | ||
$this->storeManagerMock = $this->getMock(\Magento\Store\Model\StoreManagerInterface::class); | ||
$objectHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); | ||
$context = $objectHelper->getObject( | ||
\Magento\Backend\Block\Template\Context::class, | ||
[ | ||
'storeManager' => $this->storeManagerMock, | ||
] | ||
); | ||
|
||
$this->switcherBlock = $objectHelper->getObject( | ||
\Magento\Backend\Block\Store\Switcher::class, | ||
['context' => $context] | ||
); | ||
} | ||
|
||
public function testGetWebsites() | ||
{ | ||
$websiteMock = $this->getMock(\Magento\Store\Model\Website::class, [], [], '', false); | ||
$websites = [0 => $websiteMock, 1 => $websiteMock]; | ||
$this->storeManagerMock->expects($this->once())->method('getWebsites')->will($this->returnValue($websites)); | ||
$this->assertEquals($websites, $this->switcherBlock->getWebsites()); | ||
} | ||
|
||
public function testGetWebsitesIfSetWebsiteIds() | ||
{ | ||
$websiteMock = $this->getMock(\Magento\Store\Model\Website::class, [], [], '', false); | ||
$websites = [0 => $websiteMock, 1 => $websiteMock]; | ||
$this->storeManagerMock->expects($this->once())->method('getWebsites')->will($this->returnValue($websites)); | ||
|
||
$this->switcherBlock->setWebsiteIds([1]); | ||
$expected = [1 => $websiteMock]; | ||
$this->assertEquals($expected, $this->switcherBlock->getWebsites()); | ||
} | ||
} |
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
Oops, something went wrong.