Beispiel #1
0
 /**
  * test restore of ConfigProxy.
  *
  * @covers ::__construct
  * @covers ::restore
  * @covers ::isRestored
  */
 public function testConfigProxy()
 {
     // prepare variables we need to perform tests on Config\ConfigProxy
     $container = new Container();
     $config = new Config(__DIR__ . '/ConfigTest_Resources');
     $config_dump = $config->dump();
     // set of tests on Config\ConfigProxy
     $config_proxy = new ConfigProxy();
     $this->assertFalse($config_proxy->isRestored());
     $config_proxy->restore($container, $config_dump);
     $this->assertTrue($config_proxy->isRestored());
     $this->assertEquals($config_dump, $config_proxy->dump());
 }
Beispiel #2
0
 /**
  * Test Config class proxy and dump.
  *
  * @covers ::getClassProxy
  * @covers ::dump
  */
 public function testConfigDumpable()
 {
     $config = new Config($this->test_base_dir);
     $this->assertEquals(Config::CONFIG_PROXY_CLASSNAME, $config->getClassProxy());
     $config_dump = $config->dump();
     $this->assertTrue(array_key_exists('basedir', $config_dump));
     $this->assertEquals($this->test_base_dir, $config_dump['basedir']);
     $this->assertTrue(array_key_exists('raw_parameters', $config_dump));
     $this->assertEquals(array('say' => array('hello' => 'world', 'bonjour' => 'monde', 'hola' => 'mundo')), $config_dump['raw_parameters']);
     $this->assertTrue(array_key_exists('environment', $config_dump));
     $this->assertEquals(\BackBee\BBApplication::DEFAULT_ENVIRONMENT, $config_dump['environment']);
     $this->assertTrue(array_key_exists('debug', $config_dump));
     $this->assertEquals(false, $config_dump['debug']);
     $this->assertTrue(array_key_exists('yml_names_to_ignore', $config_dump));
     $this->assertEquals(array(), $config_dump['yml_names_to_ignore']);
     $this->assertTrue(array_key_exists('has_cache', $config_dump));
     $this->assertEquals(false, $config_dump['has_cache']);
     $this->assertTrue(array_key_exists('has_container', $config_dump));
     $this->assertEquals(false, $config_dump['has_container']);
 }