mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Bark if a fixture file is missing
A missing fixture file would previously be silently ignored
This commit is contained in:
parent
0df1e90eed
commit
a6954a7abc
1 changed files with 7 additions and 0 deletions
|
@ -133,6 +133,7 @@ class CakeFixtureManager {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$loaded = false;
|
||||||
foreach ($fixturePaths as $path) {
|
foreach ($fixturePaths as $path) {
|
||||||
$className = Inflector::camelize($fixture);
|
$className = Inflector::camelize($fixture);
|
||||||
if (is_readable($path . DS . $className . 'Fixture.php')) {
|
if (is_readable($path . DS . $className . 'Fixture.php')) {
|
||||||
|
@ -141,9 +142,15 @@ class CakeFixtureManager {
|
||||||
$fixtureClass = $className . 'Fixture';
|
$fixtureClass = $className . 'Fixture';
|
||||||
$this->_loaded[$fixtureIndex] = new $fixtureClass();
|
$this->_loaded[$fixtureIndex] = new $fixtureClass();
|
||||||
$this->_fixtureMap[$fixtureClass] = $this->_loaded[$fixtureIndex];
|
$this->_fixtureMap[$fixtureClass] = $this->_loaded[$fixtureIndex];
|
||||||
|
$loaded = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$loaded) {
|
||||||
|
$firstPath = str_replace(array(APP, CAKE_CORE_INCLUDE_PATH, ROOT), '', $fixturePaths[0] . DS . $className . 'Fixture.php');
|
||||||
|
throw new UnexpectedValueException(__d('cake_dev', 'Referenced fixture class %s (%s) not found', $className, $firstPath));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue