[Nostromo] Refactor some tasks, add new tests

This commit is contained in:
Andrés Montañez
2017-01-05 20:38:42 -03:00
parent 781b5e7620
commit 68e65827fa
22 changed files with 291 additions and 62 deletions
@@ -33,20 +33,22 @@ class AsseticDumpTask extends AbstractTask
public function execute()
{
$options = $this->getOptions();
$command = $options['console'] . ' assetic:dump --env=' . $options['env'] . ' ' . $options['flags'];
$command = sprintf('%s assetic:dump --env=%s %s', $options['console'], $options['env'], $options['flags']);
/** @var Process $process */
$process = $this->runtime->runCommand($command);
$process = $this->runtime->runCommand(trim($command));
return $process->isSuccessful();
}
protected function getOptions()
{
$userOptions = $this->runtime->getConfigOptions('symfony', []);
$userGlobalOptions = $this->runtime->getConfigOptions('symfony', []);
$userEnvironmentOptions = $this->runtime->getEnvironmentConfig('symfony', []);
$options = array_merge(
['console' => 'bin/console', 'env' => 'dev', 'flags' => ''],
(is_array($userOptions) ? $userOptions : []),
(is_array($userGlobalOptions) ? $userGlobalOptions : []),
(is_array($userEnvironmentOptions) ? $userEnvironmentOptions : []),
$this->options
);