Skip to content

Commit

Permalink
Fixing of important bug - tableKey
Browse files Browse the repository at this point in the history
ChecksumTestFixture is using _getTableKey() (connection and table name) as key of $_tableHashes in insert(), but when validate modifications, it checks for just table name, which causes incorrect response of _tableUnmodified(), and creating fixtures over again and again.

Big thanks to my colleague @sukihub for finding this bug.
  • Loading branch information
samuelszabo committed Jan 23, 2019
1 parent 12d5be4 commit a748dee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/TestSuite/Fixture/ChecksumTestFixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function truncate(ConnectionInterface $db)
*/
public function drop(ConnectionInterface $db)
{
unset(static::$_tableHashes[$this->table]);
unset(static::$_tableHashes[$this->_getTableKey()]);
return parent::drop($db);
}

Expand All @@ -86,7 +86,7 @@ public function drop(ConnectionInterface $db)
protected function _tableUnmodified($db)
{
$tableKey = $this->_getTableKey();
if (!array_key_exists($this->table, static::$_tableHashes)) {
if (!array_key_exists($tableKey, static::$_tableHashes)) {
return false;
}

Expand Down

0 comments on commit a748dee

Please sign in to comment.