Skip to content

Commit

Permalink
Merge pull request #3 from World-Architects/fix-driver
Browse files Browse the repository at this point in the history
Fixing ChecksumTestFixture to work with MySQL only for now
  • Loading branch information
lorenzo authored May 8, 2017
2 parents 312fe1d + e51047e commit 0b1ea7f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/TestSuite/Fixture/ChecksumTestFixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
namespace FriendsOfCake\Fixturize\TestSuite\Fixture;

use Cake\TestSuite\Fixture\TestFixture;
use Cake\Database\Driver\Mysql;
use Cake\Datasource\ConnectionInterface;

/**
Expand Down Expand Up @@ -103,7 +104,14 @@ protected function _tableUnmodified($db)
*/
protected function _hash(ConnectionInterface $db)
{
$sth = $db->execute("CHECKSUM TABLE " . $this->table);
$driver = $db->getDriver();

if (!$driver instanceof Mysql) {
// Have no better idea right now to make it always regenerate the tables
return microtime();
}

$sth = $db->execute("CHECKSUM TABLE " . $this->table . ';');
$result = $sth->fetch('assoc');
$checksum = $result['Checksum'];
return $checksum;
Expand Down

0 comments on commit 0b1ea7f

Please sign in to comment.