File tree Expand file tree Collapse file tree 3 files changed +21
-3
lines changed
dev/tests/functional/tests/app/Magento
Catalog/Test/Block/Product Expand file tree Collapse file tree 3 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -211,10 +211,23 @@ class View extends AbstractConfigureBlock
211
211
/**
212
212
* Get block price.
213
213
*
214
+ * @param FixtureInterface|null $product
215
+ *
214
216
* @return Price
215
217
*/
216
- public function getPriceBlock ()
218
+ public function getPriceBlock (FixtureInterface $ product = null )
217
219
{
220
+ $ typeId = null ;
221
+
222
+ if ($ product ) {
223
+ $ dataConfig = $ product ->getDataConfig ();
224
+ $ typeId = isset ($ dataConfig ['type_id ' ]) ? $ dataConfig ['type_id ' ] : null ;
225
+ }
226
+
227
+ if ($ this ->hasRender ($ typeId )) {
228
+ return $ this ->callRender ($ typeId , 'getPriceBlock ' );
229
+ }
230
+
218
231
return $ this ->blockFactory ->create (
219
232
'Magento\Catalog\Test\Block\Product\Price ' ,
220
233
['element ' => $ this ->_rootElement ->find ($ this ->priceBlock , Locator::SELECTOR_XPATH )]
Original file line number Diff line number Diff line change 6
6
namespace Magento \ConfigurableProduct \Test \Block \Product ;
7
7
8
8
use Magento \ConfigurableProduct \Test \Block \Product \View \ConfigurableOptions ;
9
+ use Magento \Mtf \Client \Locator ;
9
10
use Magento \Mtf \Fixture \FixtureInterface ;
10
11
use Magento \Mtf \Fixture \InjectableFixture ;
11
12
@@ -18,9 +19,13 @@ class View extends \Magento\Catalog\Test\Block\Product\View
18
19
/**
19
20
* Gets a configurable product price block.
20
21
*
22
+ * @param FixtureInterface|null $product
23
+ *
21
24
* @return Price
25
+ *
26
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
22
27
*/
23
- public function getPriceBlock ()
28
+ public function getPriceBlock (FixtureInterface $ product = null )
24
29
{
25
30
return $ this ->blockFactory ->create (
26
31
'Magento\ConfigurableProduct\Test\Block\Product\Price ' ,
Original file line number Diff line number Diff line change @@ -171,7 +171,7 @@ protected function getHighestConfigurablePrice()
171
171
protected function verifyPriceLabel ()
172
172
{
173
173
/** @var \Magento\ConfigurableProduct\Test\Block\Product\Price $priceBlock */
174
- $ priceBlock = $ this ->productView ->getPriceBlock ();
174
+ $ priceBlock = $ this ->productView ->getPriceBlock ($ this -> product );
175
175
176
176
$ fixtureLowestPrice = $ this ->getLowestConfigurablePrice ();
177
177
$ fixtureHighestPrice = $ this ->getHighestConfigurablePrice ();
You can’t perform that action at this time.
0 commit comments