public function setUp() { $this->root = vfsStream::setup(); $this->cache_dir = $this->root->url() . DIRECTORY_SEPARATOR . '.smartrunner'; $this->fs = new FileSystem($this->root->url()); $this->config_generator = $this->prophesize('iakio\\phpunit\\smartrunner\\commands\\initcommand\\ConfigGenerator'); $this->config_generator->generate()->willReturn(new Config([])); $this->phpunit_config_generator = $this->prophesize('iakio\\phpunit\\smartrunner\\commands\\initcommand\\PhpunitConfigGenerator'); $this->command = new InitCommand($this->fs, $this->config_generator->reveal(), $this->phpunit_config_generator->reveal()); }
public function test_use_phpdbg_if_exists() { $this->fs->fileExists('vendor/bin/phpunit')->willReturn(true); $this->fs->fileExists('phpunit.phar')->willReturn(false); $this->fs->phpdbgExists()->willReturn(true); $actual = $this->generator->generate(); $this->assertThat($actual['phpunit'], $this->logicalOr('phpdbg -qrr vendor/phpunit/phpunit/phpunit', 'phpdbg -qrr vendor\\phpunit\\phpunit\\phpunit')); $this->fs->fileExists('vendor/bin/phpunit')->willReturn(false); $this->fs->fileExists('phpunit.phar')->willReturn(true); $actual = $this->generator->generate(); $this->assertThat($actual['phpunit'], $this->equalTo('phpdbg -qrr phpunit.phar')); }