mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 06:53:15 +00:00
41 lines
1.4 KiB
PHP
41 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace Alchemy\Tests\Phrasea\Command\Setup;
|
|
|
|
use Alchemy\Phrasea\Command\Setup\PluginsReset;
|
|
|
|
/**
|
|
* @group functional
|
|
* @group legacy
|
|
*/
|
|
class PluginResetTest extends \PhraseanetTestCase
|
|
{
|
|
public function testRun()
|
|
{
|
|
$input = $this->getMock('Symfony\Component\Console\Input\InputInterface');
|
|
$output = $this->getMock('Symfony\Component\Console\Output\OutputInterface');
|
|
|
|
$command = new PluginsReset();
|
|
$command->setContainer(self::$DI['cli']);
|
|
|
|
$capturedSource = null;
|
|
|
|
self::$DI['cli']['filesystem'] = $this->getMockBuilder('Alchemy\Phrasea\Filesystem\PhraseanetFilesystem')
|
|
->disableOriginalConstructor()
|
|
->getMock();
|
|
self::$DI['cli']['filesystem']->expects($this->once())
|
|
->method('remove')
|
|
->with(self::$DI['cli']['plugin.path']);
|
|
self::$DI['cli']['filesystem']->expects($this->once())
|
|
->method('mirror')
|
|
->with($this->isType('string'), self::$DI['cli']['plugin.path'])
|
|
->will($this->returnCallback(function ($source, $target) use (&$capturedSource) {
|
|
$capturedSource = $source;
|
|
}));
|
|
|
|
$this->assertEquals(0, $command->execute($input, $output));
|
|
$this->assertNotNull($capturedSource);
|
|
$this->assertEquals(realpath(__DIR__ . '/../../../../../../lib/conf.d/plugins'), realpath($capturedSource));
|
|
}
|
|
}
|