Files
Phraseanet/tests/Alchemy/Tests/Phrasea/Command/Developper/Utils/GruntDriverTest.php
2015-07-02 12:33:19 +02:00

34 lines
1.1 KiB
PHP

<?php
namespace Alchemy\Tests\Phrasea\Command\Developper\Utils;
use Alchemy\Phrasea\Command\Developer\Utils\GruntDriver;
use Alchemy\Phrasea\Core\CLIProvider\CLIDriversServiceProvider;
use Symfony\Component\Process\PhpExecutableFinder;
/**
* @group functional
* @group legacy
*/
class GruntDriverTest extends \PhraseanetTestCase
{
public function testCreate()
{
$app = $this->getApplication();
$app->register(new CLIDriversServiceProvider());
$driver = GruntDriver::create(['grunt.binaries' => $app['driver.binary-finder']('grunt', 'grunt_binary')]);
$this->assertInstanceOf('Alchemy\Phrasea\Command\Developer\Utils\GruntDriver', $driver);
$this->assertEquals('grunt', $driver->getName());
}
public function testCreateWithCustomBinary()
{
$finder = new PhpExecutableFinder();
$php = $finder->find();
$driver = GruntDriver::create(['grunt.binaries' => $php]);
$this->assertInstanceOf('Alchemy\Phrasea\Command\Developer\Utils\GruntDriver', $driver);
$this->assertEquals($php, $driver->getProcessBuilderFactory()->getBinary());
}
}