Skip to content

Commit f0a87b5

Browse files
committed
MAGETWO-50794: SampleData is not applied correctly on regression environment
- fix unit test
1 parent ad6be99 commit f0a87b5

File tree

1 file changed

+6
-1
lines changed
  • app/code/Magento/CatalogWidget/Test/Unit/Model/Rule/Condition

1 file changed

+6
-1
lines changed

app/code/Magento/CatalogWidget/Test/Unit/Model/Rule/Condition/CombineTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,13 @@ public function testGetNewChildSelectOptions()
7373
public function testCollectValidatedAttributes()
7474
{
7575
$collection = $this->getMockBuilder('\Magento\Catalog\Model\ResourceModel\Product\Collection')
76-
->disableOriginalConstructor()
76+
->disableOriginalConstructor()->setMethods(['getSelect'])
77+
->getMock();
78+
$select = $this->getMockBuilder('\Magento\Framework\DB\Select')
79+
->disableOriginalConstructor()->setMethods(['getPart'])
7780
->getMock();
81+
$select->expects($this->any())->method('getPart')->with('from')->willReturn(['alias_table' => 'table_name']);
82+
$collection->expects($this->any())->method('getSelect')->willReturn($select);
7883
$condition = $this->getMockBuilder('Magento\CatalogWidget\Model\Rule\Condition\Combine')
7984
->disableOriginalConstructor()->setMethods(['addToCollection'])
8085
->getMock();

0 commit comments

Comments
 (0)