mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 15:03:25 +00:00
39 lines
1.1 KiB
PHP
39 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace Alchemy\Tests\Phrasea\Command\Plugin;
|
|
|
|
use Alchemy\Phrasea\Command\Plugin\EnablePlugin;
|
|
|
|
/**
|
|
* @group functional
|
|
* @group legacy
|
|
*/
|
|
class EnablePluginTest extends PluginCommandTestCase
|
|
{
|
|
/**
|
|
* @dataProvider provideVariousInitialConfs
|
|
*/
|
|
public function testExecute($initial)
|
|
{
|
|
$input = $this->getMock('Symfony\Component\Console\Input\InputInterface');
|
|
$output = $this->getMock('Symfony\Component\Console\Output\OutputInterface');
|
|
$input->expects($this->once())
|
|
->method('getArgument')
|
|
->with($this->equalTo('name'))
|
|
->will($this->returnValue('test-plugin'));
|
|
|
|
self::$DI['cli']['conf']->set(['plugins', 'test-plugin', 'enabled'], $initial);
|
|
|
|
$command = new EnablePlugin();
|
|
$command->setContainer(self::$DI['cli']);
|
|
|
|
$this->assertSame(0, $command->execute($input, $output));
|
|
$this->assertTrue(self::$DI['cli']['conf']->get(['plugins', 'test-plugin', 'enabled']));
|
|
}
|
|
|
|
public function provideVariousInitialConfs()
|
|
{
|
|
return [[true], [false]];
|
|
}
|
|
}
|