/** * Build process with command * * @param $command * * @return $this */ public function setCommand($command) { // NOTE: Seems odd to have to add & then get, but the get(<class>, [$command]) does not work $this->generator->add('Symfony\\Component\\Process\\Process', function () use($command) { // @codeCoverageIgnoreStart return new Process($command); // @codeCoverageIgnoreEnd }); $this->process = $this->generator->get('Symfony\\Component\\Process\\Process'); // Allow chaining return $this; }
/** * @test */ public function it_returns_UNDEFINED_for_the_version_when_there_is_not_a_VERSION_file() { $this->files_mock->shouldReceive('get')->with(__DIR__ . DIRECTORY_SEPARATOR . "VERSION")->andThrow('Illuminate\\Contracts\\Filesystem\\FileNotFoundException')->once(); $version = $this->generator->version(); $this->assertEquals('UNDEFINED', $version); $this->assertTrue(is_string($version)); }