-
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 remote-tracking branch 'main-ce/develop' into MAGETWO-57876
- Loading branch information
Showing
12 changed files
with
98 additions
and
68 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
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
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
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
17 changes: 17 additions & 0 deletions
17
app/code/Magento/Swatches/view/frontend/layout/catalogsearch_advanced_result.xml
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,17 @@ | ||
<?xml version="1.0"?> | ||
<!-- | ||
/** | ||
* Copyright © 2016 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> | ||
<head> | ||
<css src="Magento_Swatches::css/swatches.css"/> | ||
</head> | ||
<body> | ||
<referenceBlock name="category.product.type.details.renderers"> | ||
<block class="Magento\Swatches\Block\Product\Renderer\Listing\Configurable" as="configurable" template="Magento_Swatches::product/listing/renderer.phtml" /> | ||
</referenceBlock> | ||
</body> | ||
</page> |
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