Skip to content

Commit

Permalink
Issue magento#35796 Update Unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Artem Kirkor committed Jul 27, 2022
1 parent c296e63 commit 75a5913
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,22 @@ protected function setUp(): void
public function testGetWebsiteIdsOfProduct(): void
{
$selectMock = $this->createMock(Select::class);
$statementMock = $this->createMock(\Zend_Db_Statement_Pdo::class);
$statementMock->method('fetchColumn')->willReturn(1);
$selectMock->method('from')->willReturnSelf();
$selectMock->method('where')->willReturnSelf();
$selectMock->method('query')->willReturnSelf();
$selectMock->method('query')->willReturn($statementMock);

$this->connectionMock->method('select')
->willReturn($selectMock);

$this->connectionMock->expects($this->once())
->method('fetchCol')
->with($selectMock)
->willReturn([]);

/** @var IndexTableStructure|MockObject $indexTableStructure */
$indexTableStructure = $this->createMock(IndexTableStructure::class);
$this->priceModifier->modifyPrice($indexTableStructure, []);
$this->assertEmpty($this->priceModifier->modifyPrice($indexTableStructure, [1]));
}
}

0 comments on commit 75a5913

Please sign in to comment.