Skip to content

Commit

Permalink
MAGETWO-57726: [GitHub] Exception is created but not thrown #6320
Browse files Browse the repository at this point in the history
- Refactor
  • Loading branch information
odubovyk committed Sep 1, 2016
1 parent fc20d3e commit 2e5baa1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ protected function setUp()
$contextMock = $this->getMockBuilder(\Magento\Catalog\Block\Product\Context::class)
->disableOriginalConstructor()
->getMock();

$visibilityMock = $this->getMockBuilder(\Magento\Catalog\Model\Product\Visibility::class)
->disableOriginalConstructor()
->getMock();
$this->factoryMock = $this->getMockBuilder(\Magento\Reports\Model\Product\Index\Factory::class)

$this->factoryMock = $this->getMockBuilder(Factory::class)
->disableOriginalConstructor()
->setMethods(['get'])
->getMock();
Expand All @@ -56,8 +58,8 @@ public function testGetModelException()
public function testGetModel()
{
$indexMock = $this->getMockBuilder(\Magento\Reports\Model\Product\Index\AbstractIndex::class)
->disableOriginalConstructor()
->getMock();
->disableOriginalConstructor()
->getMock();

$this->factoryMock->expects($this->once())->method('get')->willReturn($indexMock);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function testFilterByProductTypeException()
public function testFilterByProductTypeString()
{
$this->collection->filterByProductType('simple');
$whereParts = $this->collection->getSelect()->getPart(\Zend_Db_Select::WHERE);
$whereParts = $this->collection->getSelect()->getPart(\Magento\Framework\DB\Select::WHERE);
$this->assertContains('simple', $whereParts[0]);
}

Expand All @@ -55,7 +55,7 @@ public function testFilterByProductTypeString()
public function testFilterByProductTypeArray()
{
$this->collection->filterByProductType(['simple', 'configurable']);
$whereParts = $this->collection->getSelect()->getPart(\Zend_Db_Select::WHERE);
$whereParts = $this->collection->getSelect()->getPart(\Magento\Framework\DB\Select::WHERE);

$this->assertThat(
$whereParts[0],
Expand Down

0 comments on commit 2e5baa1

Please sign in to comment.