File tree Expand file tree Collapse file tree 3 files changed +17
-3
lines changed
app/code/Magento/Catalog/Block/Product/View
dev/tests/functional/tests/app/Magento/Catalog/Test/Block Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change 12
12
namespace Magento \Catalog \Block \Product \View ;
13
13
14
14
use Magento \Catalog \Model \Product ;
15
+ use Magento \Framework \Phrase ;
15
16
use Magento \Framework \Pricing \PriceCurrencyInterface ;
16
17
18
+ /**
19
+ * Product attributes block.
20
+ */
17
21
class Attributes extends \Magento \Framework \View \Element \Template
18
22
{
19
23
/**
@@ -58,6 +62,7 @@ public function getProduct()
58
62
if (!$ this ->_product ) {
59
63
$ this ->_product = $ this ->_coreRegistry ->registry ('product ' );
60
64
}
65
+
61
66
return $ this ->_product ;
62
67
}
63
68
@@ -86,7 +91,7 @@ public function getAdditionalData(array $excludeAttr = [])
86
91
$ value = $ this ->priceCurrency ->convertAndFormat ($ value );
87
92
}
88
93
89
- if (is_string ($ value ) && strlen ($ value )) {
94
+ if (( $ value instanceof Phrase || is_string ($ value) ) && strlen ($ value )) {
90
95
$ data [$ attribute ->getAttributeCode ()] = [
91
96
'label ' => __ ($ attribute ->getStoreLabel ()),
92
97
'value ' => $ value ,
@@ -95,6 +100,7 @@ public function getAdditionalData(array $excludeAttr = [])
95
100
}
96
101
}
97
102
}
103
+
98
104
return $ data ;
99
105
}
100
106
}
Original file line number Diff line number Diff line change @@ -109,6 +109,8 @@ public function openSection($sectionName)
109
109
$ sectionElement = $ this ->getContainerElement ($ sectionName );
110
110
if ($ sectionElement ->getAttribute ('type ' ) == 'button ' ) {
111
111
$ sectionElement ->click ();
112
+ // Wait until section animation finished.
113
+ $ this ->waitForElementVisible ($ this ->closeButton );
112
114
} else {
113
115
parent ::openSection ($ sectionName );
114
116
}
Original file line number Diff line number Diff line change 16
16
*/
17
17
class ListProduct extends Block
18
18
{
19
+ // @codingStandardsIgnoreStart
20
+
19
21
/**
20
22
* Locator for product item block.
21
23
*
22
24
* @var string
23
25
*/
24
26
protected $ productItem = './/*[contains(@class,"product-item-link") and normalize-space(text())="%s"]/ancestor::li ' ;
25
27
28
+ // @codingStandardsIgnoreEnd
29
+
26
30
/**
27
31
* Locator for product item link.
28
32
*
@@ -48,7 +52,7 @@ public function getProductItem(FixtureInterface $product)
48
52
$ locator = sprintf ($ this ->productItem , $ product ->getName ());
49
53
50
54
return $ this ->blockFactory ->create (
51
- ' Magento\Catalog\Test\Block\Product\ProductList\ProductItem ' ,
55
+ \ Magento \Catalog \Test \Block \Product \ProductList \ProductItem::class ,
52
56
['element ' => $ this ->_rootElement ->find ($ locator , Locator::SELECTOR_XPATH )]
53
57
);
54
58
}
@@ -77,6 +81,8 @@ public function getProductNames()
77
81
*/
78
82
public function getSortByValues ()
79
83
{
80
- return explode ("\n" , $ this ->_rootElement ->find ($ this ->sorter )->getText ());
84
+ $ sortValues = $ this ->_rootElement ->find ($ this ->sorter )->getText ();
85
+
86
+ return array_filter (array_map ("trim " , explode ("\n" , $ sortValues )));
81
87
}
82
88
}
You can’t perform that action at this time.
0 commit comments