Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ConfigurablePriceTest.php
Go to the documentation of this file.
1 <?php
7 
10 
12 {
16  protected function createModel()
17  {
18  return $this->objectManager->getObject(ConfigurablePriceModifier::class, ['locator' => $this->locatorMock]);
19  }
20 
26  public function testModifyMeta($metaInput, $metaOutput)
27  {
28  $this->productMock->expects($this->any())
29  ->method('getTypeId')
30  ->willReturn(\Magento\ConfigurableProduct\Model\Product\Type\Configurable::TYPE_CODE);
31 
32  $metaResult = $this->getModel()->modifyMeta($metaInput);
33  $this->assertEquals($metaResult, $metaOutput);
34  }
35 
39  public function metaDataProvider()
40  {
41  return [
42  [
43  'metaInput' => [
44  'product-details' => [
45  'children' => [
46  'container_price' => [
47  'children' => [
48  'advanced_pricing_button' => [
49  'arguments' => []
50  ]
51  ]
52  ]
53  ]
54  ]
55  ],
56  'metaOutput' => [
57  'product-details' => [
58  'children' => [
59  'container_price' => [
60  'children' => [
61  'advanced_pricing_button' => [
62  'arguments' => [
63  'data' => [
64  'config' => [
65  'visible' => 0,
66  'disabled' => 1,
67  'componentType' => 'container'
68  ],
69  ],
70  ],
71  ],
72  'price' => [
73  'arguments' => [
74  'data' => [
75  'config' => [
76  'component' =>
77  'Magento_ConfigurableProduct/js/components/price-configurable'
78  ],
79  ],
80  ],
81  ],
82  ],
83  ],
84  ],
85  ]
86  ]
87  ], [
88  'metaInput' => [
89  'product-details' => [
90  'children' => [
91  'container_price' => [
92  'children' => []
93  ]
94  ]
95  ]
96  ],
97  'metaOutput' => [
98  'product-details' => [
99  'children' => [
100  'container_price' => [
101  'children' => [
102  'price' => [
103  'arguments' => [
104  'data' => [
105  'config' => [
106  'component' =>
107  'Magento_ConfigurableProduct/js/components/price-configurable'
108  ]
109  ]
110  ]
111  ]
112  ]
113  ]
114  ]
115  ]
116  ]
117  ]
118  ];
119  }
120 }