mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
Refactor command line utilities
This commit is contained in:
@@ -12,7 +12,7 @@ class CustomCommand extends Command
|
||||
{
|
||||
parent::__construct('hello:world');
|
||||
}
|
||||
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$output->write('Hello World');
|
||||
|
@@ -3,6 +3,7 @@
|
||||
namespace Alchemy\Phrasea\Plugin\Management;
|
||||
|
||||
use Alchemy\Phrasea\Plugin\Management\ComposerInstaller;
|
||||
use Alchemy\Phrasea\Utilities\ComposerSetup;
|
||||
use Guzzle\Http\Client as Guzzle;
|
||||
use Symfony\Component\Process\ExecutableFinder;
|
||||
use Symfony\Component\Filesystem\Filesystem;
|
||||
@@ -26,7 +27,11 @@ class ComposerInstallerTest extends \PHPUnit_Framework_TestCase
|
||||
$this->markTestSkipped('Unable to find PHP executable.');
|
||||
}
|
||||
|
||||
$installer = new ComposerInstaller(__DIR__, new Guzzle(), $php);
|
||||
$setupMock = $this->getMockBuilder('Alchemy\Phrasea\Utilities\ComposerSetup')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$installer = new ComposerInstaller(new ComposerSetup(new Guzzle()), __DIR__, $php);
|
||||
$installer->install(__DIR__ . '/../Fixtures/PluginDir/TestPlugin');
|
||||
|
||||
$this->assertFileExists($composer);
|
||||
|
@@ -8,7 +8,7 @@ class PluginTestCase extends \PhraseanetPHPUnitAbstract
|
||||
{
|
||||
protected function createManifestValidator()
|
||||
{
|
||||
return ManifestValidator::create(self::$DI['app']);
|
||||
return ManifestValidator::create(self::$DI['cli']);
|
||||
}
|
||||
|
||||
protected function getPluginDirectory()
|
||||
|
@@ -62,12 +62,12 @@ class ManifestValidatorTest extends PluginTestCase
|
||||
*/
|
||||
public function testConstructWithInvalidSchema()
|
||||
{
|
||||
new ManifestValidator(new JsonSchemaValidator(), array(), self::$DI['app']['phraseanet.version']);
|
||||
new ManifestValidator(new JsonSchemaValidator(), array(), self::$DI['cli']['phraseanet.version']);
|
||||
}
|
||||
|
||||
public function testCreate()
|
||||
{
|
||||
$validator = ManifestValidator::create(self::$DI['app']);
|
||||
$validator = ManifestValidator::create(self::$DI['cli']);
|
||||
|
||||
$this->assertInstanceOf('Alchemy\Phrasea\Plugin\Schema\ManifestValidator', $validator);
|
||||
}
|
||||
@@ -76,6 +76,6 @@ class ManifestValidatorTest extends PluginTestCase
|
||||
{
|
||||
$schema = json_decode($this->getSchema());
|
||||
|
||||
return new ManifestValidator(new JsonSchemaValidator(), $schema, self::$DI['app']['phraseanet.version']);
|
||||
return new ManifestValidator(new JsonSchemaValidator(), $schema, self::$DI['cli']['phraseanet.version']);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user