Exemplo n.º 1
0
<?php

require_once __DIR__ . '/vendor/autoload.php';
use App\Application, App\config\Config, App\config\reader\PhpConfigReader;
try {
    $configReader = new PhpConfigReader(__DIR__ . '/config/main.php');
    $config = new Config($configReader);
    if (!$config->validate()) {
        throw new \Exception($config->getErrorMessage());
    }
    Application::getInstance($config)->run();
} catch (\Exception $e) {
    echo "ERROR\n";
    echo $e->getMessage() . "\n";
}
Exemplo n.º 2
0
 /**
  * @dataProvider _testValidateConfigDataProvider
  */
 public function testValidateConfig($config, $result)
 {
     $reader = $this->getReaderMock($config);
     $config = new Config($reader);
     $this->assertEquals($result, $config->validate());
 }