Skip to content
Permalink
Browse files

avoid fatal error by throwing exception

  • Loading branch information...
antograssiot committed Aug 26, 2014
1 parent 9d3c954 commit fe475a1a304857e6230b4a6bf96d437a601e81b9
Showing with 2 additions and 2 deletions.
  1. +1 −1 src/Utility/ObjectRegistry.php
  2. +1 −1 tests/TestCase/Datasource/ConnectionManagerTest.php
@@ -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);
}
@@ -75,7 +75,7 @@ public function testConfigVariants($settings) {
*/
public function testConfigInvalidOptions() {
ConnectionManager::config('test_variant', [
'className' => 'HerpDerp'
'className' => 'Herp\Derp'
]);
ConnectionManager::get('test_variant');
}

0 comments on commit fe475a1

Please sign in to comment.
You can’t perform that action at this time.