Address feedback

This commit is contained in:
Daniel Hensby 2018-06-19 18:31:59 +01:00 committed by Maxime Rainville
parent a7bd1a895f
commit d8430f549d
3 changed files with 6 additions and 8 deletions

View File

@ -166,7 +166,7 @@ class FixtureTestState implements TestState
$this->loadFixture($fixtureFile, $test);
}
// Flag as loaded
$this->loaded[get_class($test)] = true;
$this->loaded[strtolower(get_class($test))] = true;
}
/**
@ -265,7 +265,8 @@ class FixtureTestState implements TestState
*/
protected function resetFixtureFactory($class)
{
$this->fixtureFactories[strtolower($class)] = Injector::inst()->create(FixtureFactory::class);
$class = strtolower($class);
$this->fixtureFactories[$class] = Injector::inst()->create(FixtureFactory::class);
$this->loaded[$class] = false;
}
@ -277,6 +278,6 @@ class FixtureTestState implements TestState
*/
protected function getIsLoaded($class)
{
return !empty($this->loaded[$class]);
return !empty($this->loaded[strtolower($class)]);
}
}

View File

@ -676,7 +676,7 @@ abstract class Database
public function transactionDepth()
{
// Placeholder error for transactional DBs that don't expose depth
if ($this->supportsTransactions()) {
if (!$this->supportsTransactions()) {
user_error(get_class($this) . " does not support transactionDepth", E_USER_WARNING);
}
return 0;

View File

@ -360,10 +360,7 @@ class MySQLDatabase extends Database
return false;
}
--$this->transactionNesting;
if ($this->transactionNesting <= 0) {
$this->transactionNesting = 0;
$this->query('COMMIT AND ' . ($chain ? '' : 'NO ') . 'CHAIN');
}
return true;
}