Skip to content

Commit

Permalink
Update existing test expectations for new output.
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianHenryIE committed Dec 12, 2023
1 parent 8d3f967 commit 743e61d
Showing 1 changed file with 53 additions and 12 deletions.
65 changes: 53 additions & 12 deletions tests/Unit/Console/Commands/ComposeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use BrianHenryIE\Strauss\Console\Commands\Compose;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\ConsoleOutputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class ComposeTest extends TestCase
Expand All @@ -23,10 +24,16 @@ public function it_fails_gracefully_when_composer_json_absent(): void
chdir(sys_get_temp_dir());

$inputInterfaceMock = $this->createMock(InputInterface::class);
$outputInterfaceMock = $this->createMock(OutputInterface::class);
$outputInterfaceMock = $this->createMock(ConsoleOutputInterface::class);

$outputInterfaceMock->expects($this->any())
->method('getVerbosity')
->willReturn(PHP_INT_MAX);
$outputInterfaceMock->expects($this->any())
->method('writeln');
$outputInterfaceMock->expects($this->exactly(1))
->method('write');
->method('getErrorOutput')
->willReturn($outputInterfaceMock);

new class( $inputInterfaceMock, $outputInterfaceMock ) extends Compose {
public function __construct($inputInterfaceMock, $outputInterfaceMock)
Expand Down Expand Up @@ -55,10 +62,17 @@ public function it_handles_malformed_json_with_grace(): void
chdir(dirname($tmpfname));

$inputInterfaceMock = $this->createMock(InputInterface::class);
$outputInterfaceMock = $this->createMock(OutputInterface::class);
$outputInterfaceMock = $this->createMock(ConsoleOutputInterface::class);


$outputInterfaceMock->expects($this->any())
->method('getVerbosity')
->willReturn(PHP_INT_MAX);
$outputInterfaceMock->expects($this->any())
->method('writeln');
$outputInterfaceMock->expects($this->exactly(1))
->method('write');
->method('getErrorOutput')
->willReturn($outputInterfaceMock);

new class( $inputInterfaceMock, $outputInterfaceMock ) extends Compose {
public function __construct($inputInterfaceMock, $outputInterfaceMock)
Expand Down Expand Up @@ -88,10 +102,16 @@ public function test_it_handles_absent_extra_config_with_grace(): void
chdir(dirname($tmpfname));

$inputInterfaceMock = $this->createMock(InputInterface::class);
$outputInterfaceMock = $this->createMock(OutputInterface::class);
$outputInterfaceMock = $this->createMock(ConsoleOutputInterface::class);

$outputInterfaceMock->expects($this->any())
->method('getVerbosity')
->willReturn(PHP_INT_MAX);
$outputInterfaceMock->expects($this->any())
->method('writeln');
$outputInterfaceMock->expects($this->exactly(1))
->method('write');
->method('getErrorOutput')
->willReturn($outputInterfaceMock);

new class( $inputInterfaceMock, $outputInterfaceMock ) extends Compose {
public function __construct($inputInterfaceMock, $outputInterfaceMock)
Expand Down Expand Up @@ -121,10 +141,17 @@ public function it_handles_malformed_extra_config_with_grace(): void
chdir(dirname($tmpfname));

$inputInterfaceMock = $this->createMock(InputInterface::class);
$outputInterfaceMock = $this->createMock(OutputInterface::class);
$outputInterfaceMock = $this->createMock(ConsoleOutputInterface::class);


$outputInterfaceMock->expects($this->any())
->method('getVerbosity')
->willReturn(PHP_INT_MAX);
$outputInterfaceMock->expects($this->any())
->method('writeln');
$outputInterfaceMock->expects($this->exactly(1))
->method('write');
->method('getErrorOutput')
->willReturn($outputInterfaceMock);

new class( $inputInterfaceMock, $outputInterfaceMock ) extends Compose {
public function __construct($inputInterfaceMock, $outputInterfaceMock)
Expand Down Expand Up @@ -153,10 +180,17 @@ public function it_handles_absent_mozart_config_with_grace(): void
chdir(dirname($tmpfname));

$inputInterfaceMock = $this->createMock(InputInterface::class);
$outputInterfaceMock = $this->createMock(OutputInterface::class);
$outputInterfaceMock = $this->createMock(ConsoleOutputInterface::class);


$outputInterfaceMock->expects($this->any())
->method('getVerbosity')
->willReturn(PHP_INT_MAX);
$outputInterfaceMock->expects($this->any())
->method('writeln');
$outputInterfaceMock->expects($this->exactly(1))
->method('write');
->method('getErrorOutput')
->willReturn($outputInterfaceMock);

new class( $inputInterfaceMock, $outputInterfaceMock ) extends Compose {
public function __construct($inputInterfaceMock, $outputInterfaceMock)
Expand Down Expand Up @@ -187,10 +221,17 @@ public function it_handles_malformed_mozart_config__with_grace(): void
chdir(dirname($tmpfname));

$inputInterfaceMock = $this->createMock(InputInterface::class);
$outputInterfaceMock = $this->createMock(OutputInterface::class);
$outputInterfaceMock = $this->createMock(ConsoleOutputInterface::class);


$outputInterfaceMock->expects($this->any())
->method('getVerbosity')
->willReturn(PHP_INT_MAX);
$outputInterfaceMock->expects($this->any())
->method('writeln');
$outputInterfaceMock->expects($this->exactly(1))
->method('write');
->method('getErrorOutput')
->willReturn($outputInterfaceMock);

new class( $inputInterfaceMock, $outputInterfaceMock ) extends Compose {
public function __construct($inputInterfaceMock, $outputInterfaceMock)
Expand Down

0 comments on commit 743e61d

Please sign in to comment.