Skip to content

Commit

Permalink
Add tests for console commands
Browse files Browse the repository at this point in the history
  • Loading branch information
nguereza-tony committed Nov 20, 2023
1 parent c9292f9 commit b53b247
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tests/Console/Command/MaintenanceCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,13 @@ public function testExecuteWrongRetryValue(): void
$o = new MaintenanceCommand($app, $mockInfo[3]);
$o->bind($mockInfo[0]);

$o->parse(['platine', 'down', '-r=-10']);
$this->expectExceptionMessage(RuntimeException::class);
$this->expectExceptionMessage('Invalid retry value [0], must be an integer greather than zero');

$o->parse(['platine', 'down', '-r=0']);
$this->assertEquals('maintenance', $o->getName());

$o->interact($mockInfo[1], $mockInfo[2]);
$o->execute();

$expected = '';

$this->assertEquals($expected, $this->getConsoleOutputContent());
}
}

0 comments on commit b53b247

Please sign in to comment.