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

Make it possible to use different fixtures for same tables. #8

Open
wants to merge 1 commit into
base: master
from
Open
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -39,7 +39,7 @@ public function insert(ConnectionInterface $db)
}

$result = parent::insert($db);
static::$_tableHashes[$this->_getTableKey()] = $this->_hash($db);
static::$_tableHashes[get_class($this)] = $this->_hash($db);
return $result;
}

@@ -68,7 +68,7 @@ public function truncate(ConnectionInterface $db)
*/
public function drop(ConnectionInterface $db)
{
unset(static::$_tableHashes[$this->table]);
unset(static::$_tableHashes[get_class($this)]);
return parent::drop($db);
}

@@ -85,12 +85,12 @@ public function drop(ConnectionInterface $db)
*/
protected function _tableUnmodified($db)
{
$tableKey = $this->_getTableKey();
if (empty(static::$_tableHashes[$tableKey])) {
$fixtureKey = get_class($this);
if (empty(static::$_tableHashes[$fixtureKey])) {
return false;
}

if (static::$_tableHashes[$tableKey] === $this->_hash($db)) {
if (static::$_tableHashes[$fixtureKey] === $this->_hash($db)) {
return true;
}

@@ -117,14 +117,4 @@ protected function _hash(ConnectionInterface $db)
$checksum = $result['Checksum'];
return $checksum;
}

/**
* Get the key for table hashes
*
* @return string key for specify connection and table
*/
protected function _getTableKey ()
{
return $this->connection() . '-' . $this->table;
}
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.