Skip to content

Commit

Permalink
[Nostromo] Improve Tests and Coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
andres-montanez committed Jan 29, 2017
1 parent c98af5d commit 12d9352
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/MageApplicationTest.php
Expand Up @@ -28,6 +28,8 @@ public function testInValidConfiguration()
{
try {
$application = new MageApplication(__DIR__ . '/Resources/invalid.yml');
$application->configure();
$this->assertTrue(false, 'Application did not throw exception.');
} catch (Exception $exception) {
$this->assertTrue($exception instanceof RuntimeException);
$this->assertEquals(sprintf('The file "%s" does not have a valid Magallanes configuration.', __DIR__ . '/Resources/invalid.yml'), $exception->getMessage());
Expand All @@ -38,6 +40,8 @@ public function testParserError()
{
try {
$application = new MageApplication(__DIR__ . '/Resources/invalid-yaml.yml');
$application->configure();
$this->assertTrue(false, 'Application did not throw exception.');
} catch (Exception $exception) {
$this->assertTrue($exception instanceof RuntimeException);
$this->assertEquals(sprintf('Error parsing the file "%s".', __DIR__ . '/Resources/invalid-yaml.yml'), $exception->getMessage());
Expand All @@ -48,6 +52,8 @@ public function testInvalidFile()
{
try {
$application = new MageApplication(__DIR__ . '/Resources/this-does-not-exists.yml');
$application->configure();
$this->assertTrue(false, 'Application did not throw exception.');
} catch (Exception $exception) {
$this->assertTrue($exception instanceof RuntimeException);
$this->assertEquals(sprintf('The file "%s" does not exists or is not readable.', __DIR__ . '/Resources/this-does-not-exists.yml'), $exception->getMessage());
Expand Down

0 comments on commit 12d9352

Please sign in to comment.