Skip to content

Commit

Permalink
restore
Browse files Browse the repository at this point in the history
  • Loading branch information
danepowell committed Sep 27, 2024
1 parent 7981b59 commit cead75b
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions tests/phpunit/src/Misc/LocalMachineHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,34 @@ public function testStartBrowser(): void
}

/**
* @group serial
* @return bool[][]
*/
public function testExecuteFromCmd(): void
public function providerTestExecuteFromCmd(): array
{
return [
[false, null, null],
[false, false, false],
[true, false, false],
];
}

/**
* @dataProvider providerTestExecuteFromCmd()
*/
public function testExecuteFromCmd(bool $interactive, bool|null $isTty, bool|null $printOutput): void
{
$localMachineHelper = $this->localMachineHelper;
$process = $localMachineHelper->executeFromCmd('echo "hello world"');
$localMachineHelper->setIsTty($isTty);
$this->input->setInteractive($interactive);
$process = $localMachineHelper->executeFromCmd('echo "hello world"', null, null, $printOutput);
$this->assertTrue($process->isSuccessful());
assert(is_a($this->output, BufferedOutput::class));
$buffer = $this->output->fetch();
$this->assertStringContainsString("hello world", $buffer);
if ($printOutput === false) {
$this->assertEmpty($buffer);
} else {
$this->assertStringContainsString("hello world", $buffer);
}
}

public function testExecuteWithCwd(): void
Expand Down

0 comments on commit cead75b

Please sign in to comment.