Skip to content

Commit

Permalink
CLI-1405: LocalMachineHelperTest::testExecuteFromCmd failure
Browse files Browse the repository at this point in the history
  • Loading branch information
danepowell committed Sep 26, 2024
1 parent fa517ff commit 6ae77ed
Showing 1 changed file with 3 additions and 24 deletions.
27 changes: 3 additions & 24 deletions tests/phpunit/src/Misc/LocalMachineHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,35 +20,14 @@ public function testStartBrowser(): void
putenv('DISPLAY');
}

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

public function testExecuteWithCwd(): void
Expand Down

0 comments on commit 6ae77ed

Please sign in to comment.