Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
BundleSkuTest.php
Go to the documentation of this file.
1 <?php
7 
10 
12 {
16  protected function createModel()
17  {
18  return $this->objectManager->getObject(
19  BundleSku::class,
20  ['arrayManager' => $this->arrayManagerMock]
21  );
22  }
23 
24  public function testModifyMeta()
25  {
26  $skuTypePath = 'bundle-items/children/' . BundleSku::CODE_SKU_TYPE;
27  $skuTypeConfigPath = $skuTypePath . BundleSku::META_CONFIG_PATH;
28  $sourceMeta = [
29  'bundle-items' => [
30  'children' => [
32  ]
33  ]
34  ];
35  $skuTypeParams = [
36  'valueMap' => [
37  'false' => '1',
38  'true' => '0'
39  ],
40  'validation' => [
41  'required-entry' => false
42  ]
43  ];
44  $skuTypeMeta = [
45  'bundle-items' => [
46  'children' => [
47  BundleSku::CODE_SKU_TYPE => $skuTypeParams
48  ]
49  ]
50  ];
51 
52  $this->arrayManagerMock->expects(static::any())
53  ->method('findPath')
54  ->willReturnMap(
55  [
56  [
58  $sourceMeta,
59  null,
60  'children',
62  $skuTypePath
63  ]
64  ]
65  );
66  $this->arrayManagerMock->expects($this->once())
67  ->method('merge')
68  ->with($skuTypeConfigPath, $sourceMeta, $skuTypeParams)
69  ->willReturn($skuTypeMeta);
70 
71  $this->assertSame($skuTypeMeta, $this->getModel()->modifyMeta($sourceMeta));
72  }
73 
74  public function testModifyData()
75  {
76  $expectedData = [];
77  $this->assertEquals($expectedData, $this->getModel()->modifyData($expectedData));
78  }
79 }
return false
Definition: gallery.phtml:36