Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CakePHP 4.x compatibility #19

Merged
merged 8 commits into from
Feb 17, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
add comments back
swiffer committed Dec 29, 2019

Partially verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
We cannot verify signatures from co-authors, and some of the co-authors attributed to this commit require their commits to be signed.
commit e86f1030de96659c872b6f327a5b545ecb10b4ca
23 changes: 19 additions & 4 deletions src/TestSuite/Fixture/ChecksumTestFixture.php
Original file line number Diff line number Diff line change
@@ -25,7 +25,15 @@ class ChecksumTestFixture extends TestFixture
protected static $_tableHashes = [];

/**
* @inheritDoc
* Inserts records in the database
*
* This will only happen if the underlying table is modified in any way or
* does not exist with a hash yet.
*
* @param \Cake\Datasource\ConnectionInterface $db An instance of the connection
* into which the records will be inserted.
* @return \Cake\Database\StatementInterface|bool on success or if there are no records to insert,
* or false on failure.
*/
public function insert(ConnectionInterface $db)
{
@@ -40,7 +48,12 @@ public function insert(ConnectionInterface $db)
}

/**
* @inheritDoc
* Deletes all table information.
*
* This will only happen if the underlying table is modified in any way
*
* @param \Cake\Datasource\ConnectionInterface $db A reference to a db instance
* @return bool
*/
public function truncate(ConnectionInterface $db): bool
{
@@ -52,7 +65,10 @@ public function truncate(ConnectionInterface $db): bool
}

/**
* @inheritDoc
* Drops the table from the test datasource
*
* @param \Cake\Datasource\ConnectionInterface $db An instance of the connection the fixture should be removed from.
* @return bool True on success, false on failure.
*/
public function drop(ConnectionInterface $db): bool
{
@@ -101,7 +117,6 @@ protected function _hash(ConnectionInterface $db): string

return $sth->fetchColumn(1);
}

// Have no better idea right now to make it always regenerate the tables
return microtime();
}