Skip to content

Commit

Permalink
avoid fatal error by throwing exception
Browse files Browse the repository at this point in the history
  • Loading branch information
antograssiot committed Aug 26, 2014
1 parent 9d3c954 commit fe475a1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Utility/ObjectRegistry.php
Expand Up @@ -72,7 +72,7 @@ public function load($objectName, $config = []) {
$objectName = $config['className'];
}
$className = $this->_resolveClassName($objectName);
if (!$className) {
if (!$className || (is_string($className) && !class_exists($className))) {
list($plugin, $objectName) = pluginSplit($objectName);
$this->_throwMissingClassError($objectName, $plugin);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Datasource/ConnectionManagerTest.php
Expand Up @@ -75,7 +75,7 @@ public function testConfigVariants($settings) {
*/
public function testConfigInvalidOptions() {
ConnectionManager::config('test_variant', [
'className' => 'HerpDerp'
'className' => 'Herp\Derp'
]);
ConnectionManager::get('test_variant');
}
Expand Down

0 comments on commit fe475a1

Please sign in to comment.