|
6 | 6 | namespace Magento\Catalog\Test\Unit\Ui\DataProvider\Product\Form\Modifier; |
7 | 7 |
|
8 | 8 | use Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Websites; |
9 | | -use Magento\Store\Api\WebsiteRepositoryInterface; |
10 | 9 | use Magento\Store\Api\GroupRepositoryInterface; |
11 | 10 | use Magento\Store\Api\StoreRepositoryInterface; |
| 11 | +use Magento\Store\Api\WebsiteRepositoryInterface; |
| 12 | +use Magento\Store\Model\Group; |
| 13 | +use Magento\Store\Model\Store as StoreView; |
12 | 14 | use Magento\Store\Model\StoreManagerInterface; |
13 | | -use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; |
14 | 15 | use Magento\Store\Model\Website; |
15 | | -use Magento\Store\Model\Store as StoreView; |
16 | | -use Magento\Store\Model\Group; |
17 | 16 |
|
18 | 17 | /** |
19 | | - * Class WebsitesTest |
| 18 | + * Class WebsitesTest test the meta data and website data for different websites |
20 | 19 | * |
21 | 20 | * @SuppressWarnings(PHPMD.CouplingBetweenObjects) |
22 | 21 | */ |
@@ -111,7 +110,7 @@ protected function setUp() |
111 | 110 | ->method('getWebsiteIds') |
112 | 111 | ->willReturn($this->assignedWebsites); |
113 | 112 | $this->storeManagerMock = $this->getMockBuilder(\Magento\Store\Model\StoreManagerInterface::class) |
114 | | - ->setMethods(['isSingleStoreMode', 'getWesites']) |
| 113 | + ->setMethods(['isSingleStoreMode', 'getWebsites']) |
115 | 114 | ->getMockForAbstractClass(); |
116 | 115 | $this->storeManagerMock->method('getWebsites') |
117 | 116 | ->willReturn([$this->websiteMock, $this->secondWebsiteMock]); |
@@ -182,6 +181,14 @@ public function testModifyMeta() |
182 | 181 | $this->assertTrue(isset($meta['websites']['children'][self::SECOND_WEBSITE_ID])); |
183 | 182 | $this->assertTrue(isset($meta['websites']['children'][self::WEBSITE_ID])); |
184 | 183 | $this->assertTrue(isset($meta['websites']['children']['copy_to_stores.' . self::WEBSITE_ID])); |
| 184 | + $this->assertEquals( |
| 185 | + $meta['websites']['children'][self::SECOND_WEBSITE_ID]['arguments']['data']['config']['value'], |
| 186 | + (string) self::SECOND_WEBSITE_ID |
| 187 | + ); |
| 188 | + $this->assertEquals( |
| 189 | + $meta['websites']['children'][self::WEBSITE_ID]['arguments']['data']['config']['value'], |
| 190 | + "0" |
| 191 | + ); |
185 | 192 | } |
186 | 193 |
|
187 | 194 | /** |
|
0 commit comments