Skip to content

Instantly share code, notes, and snippets.

@deleugpn
Last active September 21, 2017 18:18
Show Gist options
  • Select an option

  • Save deleugpn/0e5c334efe3b16d2aa84d50aaeba9157 to your computer and use it in GitHub Desktop.

Select an option

Save deleugpn/0e5c334efe3b16d2aa84d50aaeba9157 to your computer and use it in GitHub Desktop.
<?php
namespace Tests\Fake;
use App\Process;
use PHPUnit\Framework\Assert as PHPUnit;
class ProcessFake extends Process
{
/**
* @var array
*/
protected $commands = [];
public function run($command, $directory = null)
{
$this->commands[] = $command;
}
public function assertExecuted($command)
{
PHPUnit::assertTrue(
in_array($command, $this->commands),
"The expected $command was never executed"
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment