$fileNotExists = $dataDir . '/config.filenotexists.yml'; $templateFile = $dataDir . '/template.config.yml'; $templateFileNotExists = $dataDir . '/template.notexists.sample.yml'; $t = new lime_test(16); $t->comment('Check Configuration'); $t->comment(' 1. Config file checks correctly'); $checker = new nbConfigurationChecker(array('verbose' => true, 'logger' => nbLogger::getInstance())); $t->ok($checker->checkConfigFile($templateFile, $configFileOk), 'Project configuration checked successfully'); $t->comment(' 2. Config file has errors (no child and no required field)'); try { $checker->checkConfigFile($templateFile, $configFileNoField); $t->fail('Config file without required field not checked successfully'); } catch (Exception $e) { $t->pass('Config file without required field not checked successfully'); } $t->ok($checker->hasErrors(), 'Config file has errors'); $t->is(count($checker->getErrors()), 2, 'Config file has 2 errors'); $errors = array('app_required_field' => 'required', 'app_required_child_field' => 'required'); $t->is($checker->getErrors(), $errors, 'Config file has errors formatted correctly'); $t->comment(' 3. Config file has errors (no child)'); try { $checker->checkConfigFile($templateFile, $configFileNoChild); $t->fail('Config file without required child not checked successfully'); } catch (Exception $e) { $t->pass('Config file without required child not checked successfully'); } $t->ok($checker->hasErrors(), 'Config file has errors'); $t->is(count($checker->getErrors()), 1, 'Config file has 1 errors'); $t->comment(' 4. Config file checks if files exist'); try { $checker->checkConfigFile($templateFile, $configFileNotExists);