Files
Phraseanet/tests/Alchemy/Tests/Phrasea/Utilities/ComposerSetupTest.php
2013-07-16 16:01:17 +02:00

35 lines
896 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;
class ComposerSetupTest extends \PHPUnit_Framework_TestCase
{
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(array($php, $target, '--version'))->getProcess();
$process->run();
$this->assertTrue($process->isSuccessful());
$this->assertSame(0, strpos($process->getOutput(), 'Composer version'));
unlink($target);
}
}