/** * @expectedException Simope\Exception\ConfigException * @expectedExceptionMessage Given environment is not allowed */ public function testNotProperEnvException() { $config = new Config(__DIR__ . '/../storage', __DIR__ . '/../test_config.json'); $config->set('container_class', 'nonexistingclass'); try { $config->setDebugMode('foo'); } catch (Exception $e) { return; } $this->fail('An expected exception has not been raised.'); }
/** * @expectedException Simope\Exception\ContainerFactoryException * @expectedExceptionMessage Could not create instance of Container class */ public function testCantCreateException() { $config = new Config(__DIR__ . '/../storage', __DIR__ . '/../test_config.json'); $config->set('container_class', 'nonexistingclass'); try { ContainerFactory::create($config); } catch (Exception $e) { return; } $this->fail('An expected exception has not been raised.'); }