Exemplo n.º 1
0
 /**
  * @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.');
 }
Exemplo n.º 2
0
 /**
  * @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.');
 }