Skip to content

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
engcom-Charlie committed Nov 30, 2020
1 parent 46429a4 commit 4ad7aae
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,18 @@ public function testBuildStatementIgnoredColumnSubscriptionLevel(): void
->method('getViewId')
->willReturn($viewId);

$this->viewMock->expects($this->once())
->method('getSubscriptions')
->willReturn(
[
$this->tableName => ['name' => $this->tableName, 'column' => 'columnName'],
'cataloginventory_stock_item' => ['name' => 'otherTableName', 'column' => 'columnName']
]
);
$this->viewMock->expects($this->once())
->method('getChangeLog')
->willReturn($otherChangelogMock);

$model = new Subscription(
$this->resourceMock,
$this->triggerFactoryMock,
Expand All @@ -396,7 +408,7 @@ public function testBuildStatementIgnoredColumnSubscriptionLevel(): void

$method = new \ReflectionMethod($model, 'buildStatement');
$method->setAccessible(true);
$statement = $method->invoke($model, Trigger::EVENT_UPDATE, $otherChangelogMock);
$statement = $method->invoke($model, Trigger::EVENT_UPDATE, $this->viewMock);

$this->assertStringNotContainsString($ignoredColumnName, $statement);
$this->assertStringContainsString($notIgnoredColumnName, $statement);
Expand Down

0 comments on commit 4ad7aae

Please sign in to comment.