mirror of
https://github.com/hauke68/Magallanes.git
synced 2026-09-07 18:08:57 +02:00
[Issue-380] Throw exception if log_dir is defined but doesn't exists
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
namespace Mage\Tests\Command\BuiltIn;
|
||||
|
||||
use Mage\Command\BuiltIn\DeployCommand;
|
||||
use Mage\Runtime\Exception\RuntimeException;
|
||||
use Mage\Tests\MageApplicationMockup;
|
||||
use Mage\Command\AbstractCommand;
|
||||
use Symfony\Component\Console\Tester\CommandTester;
|
||||
@@ -36,6 +37,24 @@ class DeployCommandMiscTest extends TestCase
|
||||
$this->assertEquals(0, $tester->getStatusCode());
|
||||
}
|
||||
|
||||
public function testInvalidLog()
|
||||
{
|
||||
$application = new MageApplicationMockup(__DIR__ . '/../../Resources/invalid-log.yml');
|
||||
|
||||
/** @var AbstractCommand $command */
|
||||
$command = $application->find('deploy');
|
||||
$this->assertTrue($command instanceof DeployCommand);
|
||||
|
||||
try {
|
||||
$tester = new CommandTester($command);
|
||||
$tester->execute(['command' => $command->getName(), 'environment' => 'test']);
|
||||
} catch (RuntimeException $exception) {
|
||||
$this->assertEquals('The configured log_dir "/no-temp" does not exists or is not a directory.', $exception->getMessage());
|
||||
} catch (\Exception $exception) {
|
||||
$this->assertFalse(true, sprintf('Exception "%s" catched, message: "%s"', get_class($exception), $exception->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
public function testDeploymentWithSudo()
|
||||
{
|
||||
$application = new MageApplicationMockup(__DIR__ . '/../../Resources/testhost-sudo.yml');
|
||||
|
||||
Reference in New Issue
Block a user