Skip to content

Commit

Permalink
Remove withConsecutive() since it isn't supported in PHPUnit 10.0 (#244)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbyoung committed Jan 3, 2023
1 parent 842a865 commit aa73200
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions src/Console/tests/ConsoleGatewayTest.php
Expand Up @@ -29,6 +29,7 @@
use Aphiria\Console\Tests\Output\Mocks\Output;
use Aphiria\DependencyInjection\IServiceResolver;
use Exception;
use Mockery;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;

Expand All @@ -47,16 +48,20 @@ protected function setUp(): void
$this->output = new Output();
}

protected function tearDown(): void
{
Mockery::close();
}

public function testHandlingCommandWithNoHandlerThrowsException(): void
{
$output = $this->createMock(IOutput::class);
$output->expects($this->exactly(3))
->method('writeln')
->withConsecutive(
['<fatal>' . CommandNotFoundException::class . '</fatal>: <info>No command found with name "foo"</info>'],
['Stack trace:'],
[$this->anything()]
);
$output = Mockery::mock(IOutput::class);
$output->shouldReceive('writeln')
->with('<fatal>' . CommandNotFoundException::class . '</fatal>: <info>No command found with name "foo"</info>');
$output->shouldReceive('writeln')
->with('Stack trace:');
$output->shouldReceive('writeln')
->withAnyArgs();
$status = $this->consoleGateway->handle(new Input('foo'), $output);
$this->assertSame(StatusCode::Error, $status);
}
Expand Down

0 comments on commit aa73200

Please sign in to comment.