mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
Add exception if less file doest not exists or destination dir is not writable
Fix tests
This commit is contained in:
@@ -47,6 +47,16 @@ class LessCompiler extends Command
|
|||||||
foreach ($files as $lessFile => $buildFile) {
|
foreach ($files as $lessFile => $buildFile) {
|
||||||
$this->container['filesystem']->mkdir(dirname($buildFile));
|
$this->container['filesystem']->mkdir(dirname($buildFile));
|
||||||
$output->writeln(sprintf('Building %s', basename($lessFile)));
|
$output->writeln(sprintf('Building %s', basename($lessFile)));
|
||||||
|
|
||||||
|
if (!is_file($lessFile)) {
|
||||||
|
throw new \Exception(realpath($lessFile) . ' does not exists');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!is_writable(dirname($buildFile))) {
|
||||||
|
throw new \Exception(realpath(dirname($buildFile)) . ' is not writable');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$builder = ProcessBuilder::create(array(
|
$builder = ProcessBuilder::create(array(
|
||||||
'recess',
|
'recess',
|
||||||
'--compile',
|
'--compile',
|
||||||
|
@@ -51,7 +51,7 @@ class PhraseaRegisterFormTest extends FormTestCase
|
|||||||
|
|
||||||
$form = new PhraseaRegisterForm(self::$DI['app'], $available, $params, new Camelizer());
|
$form = new PhraseaRegisterForm(self::$DI['app'], $available, $params, new Camelizer());
|
||||||
|
|
||||||
$this->assertCount(9, self::$DI['app']->form($form)->createView()->vars['form']->children);
|
$this->assertCount(8, self::$DI['app']->form($form)->createView()->vars['form']->children);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testFormDoesNotRegisterNonValidFields()
|
public function testFormDoesNotRegisterNonValidFields()
|
||||||
@@ -75,6 +75,6 @@ class PhraseaRegisterFormTest extends FormTestCase
|
|||||||
|
|
||||||
$form = new PhraseaRegisterForm(self::$DI['app'], $available, $params, new Camelizer());
|
$form = new PhraseaRegisterForm(self::$DI['app'], $available, $params, new Camelizer());
|
||||||
|
|
||||||
$this->assertCount(8, self::$DI['app']->form($form)->createView()->vars['form']->children);
|
$this->assertCount(7, self::$DI['app']->form($form)->createView()->vars['form']->children);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user