assert(!$config->areColorsEnabled(), "colors should be disabled");
assert($config->shouldStopOnFailure(), "should stop on failure");
assert($config->getConfigurationFile() == __FILE__, "config should be current file");
};
});
describe("->read()", function () {
it("should return configuration from InputInterface", function () {
$reader = new ConfigurationReader($this->input);
$config = $reader->read();
call_user_func($this->assert, $config);
});
it("should throw an exception if configuration is specified but does not exist", function () {
$this->definition['--configuration'] = '/path/to/nope.php';
$input = new ArrayInput($this->definition, new InputDefinition());
$reader = new ConfigurationReader($input);
$exception = null;
try {
$reader->read();
} catch (\RuntimeException $e) {
$exception = $e;
}
assert(!is_null($exception), "exception should not be null");
});
});
describe('::readInput()', function () {
it('should read input', function () {
$config = ConfigurationReader::readInput($this->input);
call_user_func($this->assert, $config);
});
});
});