Skip to content

Commit 3b14dd5

Browse files
committed
MAGETWO-55794: [FT] Product is not assigned to category
1 parent a7c646e commit 3b14dd5

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ProductList/TopToolbar.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ class TopToolbar extends Block
2828
*/
2929
public function getSelectSortType()
3030
{
31-
return $this->_rootElement->find("#sorter")->getElements('option[selected]')[0]->getText();
31+
$selectedOption = $this->_rootElement->find($this->sorter)->getElements('option[selected]')[0]->getText();
32+
preg_match('/\w+\s?\w+/', $selectedOption, $matches);
33+
return $matches[0];
3234
}
3335

3436
/**
@@ -38,7 +40,8 @@ public function getSelectSortType()
3840
*/
3941
public function getSortType()
4042
{
41-
$content = str_replace("\r", '', $this->_rootElement->find($this->sorter)->getText());
42-
return explode("\n", $content);
43+
$content = $this->_rootElement->find($this->sorter)->getText();
44+
preg_match_all('/\w+\s?\w+/', $content, $matches);
45+
return $matches[0];
4346
}
4447
}

dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/Category.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
<field name="name" xsi:type="string">Category%isolation%</field>
6868
<field name="url_key" xsi:type="string">category-%isolation%</field>
6969
<field name="parent_id" xsi:type="array">
70-
<item name="dataset" xsi:type="string">default_subcategory</item>
70+
<item name="dataset" xsi:type="string">default</item>
7171
</field>
7272
<field name="is_active" xsi:type="string">Yes</field>
7373
<field name="include_in_menu" xsi:type="string">Yes</field>

0 commit comments

Comments
 (0)