Exemplo n.º 1
0
 public function testRoutesShouldBeEmptyWhenNoRouteFileExists()
 {
     $config = new \Nano\Application\Config($this->files->get($this, '/configs/no-routes'), new \Nano\Application\Config\Format\Php());
     self::assertEquals(new \Nano\Routes(), $config->routes());
 }
Exemplo n.º 2
0
 public function testApplicationInstanceShoultBeAvailableInConfigSource()
 {
     $path = $this->files->get($this, '/settings');
     $this->builder->setSource($this->files->get($this, '/application'));
     $this->builder->setDestination($path);
     $this->builder->build('default');
     self::assertFileExists($path . DS . \Nano\Application\Config::CONFIG_FILE_NAME);
     self::assertFileExists($path . DS . \Nano\Application\Config::ROUTES_FILE_NAME);
     $config = new \Nano\Application\Config($path, $this->application->configFormat);
     self::assertTrue($config->exists('config'));
     self::assertInstanceOf('stdClass', $config->get('config'));
     self::assertObjectHasAttribute('root', $config->get('config'));
     self::assertEquals($this->application->rootDir, $config->get('config')->root);
 }