Files
Phraseanet/tests/Alchemy/Tests/Phrasea/Utilities/ComposerSetupTest.php
2015-06-15 19:30:51 +02:00

39 lines
929 B
PHP

<?php
namespace Alchemy\Tests\Phrasea\Utilities;
use Alchemy\Phrasea\Utilities\ComposerSetup;
use Guzzle\Http\Client as Guzzle;
use Symfony\Component\Process\PhpExecutableFinder;
use Symfony\Component\Process\ProcessBuilder;
/**
* @group functional
* @group legacy
*/
class ComposerSetupTest extends \PhraseanetTestCase
{
public function testSetup()
{
$target = __DIR__ . '/target-composer';
if (is_file($target)) {
unlink($target);
}
$setup = new ComposerSetup(new Guzzle());
$setup->setup($target);
$finder = new PhpExecutableFinder();
$php = $finder->find();
$process = ProcessBuilder::create([$php, $target, '--version'])->getProcess();
$process->run();
$this->assertTrue($process->isSuccessful());
$this->assertSame(0, strpos($process->getOutput(), 'Composer version'));
unlink($target);
}
}