mirror of https://github.com/hauke68/Magallanes
Andrés Montañez
8 years ago
5 changed files with 286 additions and 0 deletions
@ -0,0 +1,49 @@ |
|||||||
|
<?php |
||||||
|
/* |
||||||
|
* This file is part of the Magallanes package. |
||||||
|
* |
||||||
|
* (c) Andrés Montañez <andres@andresmontanez.com> |
||||||
|
* |
||||||
|
* For the full copyright and license information, please view the LICENSE |
||||||
|
* file that was distributed with this source code. |
||||||
|
*/ |
||||||
|
|
||||||
|
namespace Mage\Tests; |
||||||
|
|
||||||
|
use Mage\MageApplication; |
||||||
|
use Mage\Runtime\Exception\RuntimeException; |
||||||
|
use Exception; |
||||||
|
use PHPUnit_Framework_TestCase as TestCase; |
||||||
|
|
||||||
|
class MageApplicationTest extends TestCase |
||||||
|
{ |
||||||
|
public function testValidConfiguration() |
||||||
|
{ |
||||||
|
$application = new MageApplication(); |
||||||
|
$application->configure(__DIR__ . '/Resources/basic.yml'); |
||||||
|
$this->assertTrue($application instanceof MageApplication); |
||||||
|
} |
||||||
|
|
||||||
|
public function testInValidConfiguration() |
||||||
|
{ |
||||||
|
try { |
||||||
|
$application = new MageApplication(); |
||||||
|
$application->configure(__DIR__ . '/Resources/invalid.yml'); |
||||||
|
} catch (Exception $exception) { |
||||||
|
$this->assertTrue($exception instanceof RuntimeException); |
||||||
|
$this->assertEquals(sprintf('The file "%s" does not have a valid Magallanes configuration.', __DIR__ . '/Resources/invalid.yml'), $exception->getMessage()); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public function testInValidFile() |
||||||
|
{ |
||||||
|
try { |
||||||
|
$application = new MageApplication(); |
||||||
|
$application->configure(__DIR__ . '/Resources/this-does-not-exists.yml'); |
||||||
|
} catch (Exception $exception) { |
||||||
|
$this->assertTrue($exception instanceof RuntimeException); |
||||||
|
$this->assertEquals(sprintf('The file "%s" does not exists or is not readable.', __DIR__ . '/Resources/this-does-not-exists.yml'), $exception->getMessage()); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,27 @@ |
|||||||
|
magephp: |
||||||
|
log_dir: /tmp |
||||||
|
environments: |
||||||
|
production: |
||||||
|
user: app |
||||||
|
branch: master |
||||||
|
host_path: /var/www/myapp |
||||||
|
releases: 4 |
||||||
|
exclude: |
||||||
|
- ./var/cache/* |
||||||
|
- ./var/log/* |
||||||
|
- ./web/app_dev.php |
||||||
|
hosts: |
||||||
|
- webserver1 |
||||||
|
- webserver2 |
||||||
|
- webserver3 |
||||||
|
pre-deploy: |
||||||
|
- git/update |
||||||
|
- composer/install |
||||||
|
- composer/generate-autoload |
||||||
|
on-deploy: |
||||||
|
- symfony/cache-warmup: { env: 'dev' } |
||||||
|
- symfony/assets-install: { env: 'dev' } |
||||||
|
- symfony/assetic-dump: { env: 'dev' } |
||||||
|
on-release: |
||||||
|
post-release: |
||||||
|
post-deploy: |
@ -0,0 +1,36 @@ |
|||||||
|
<?php |
||||||
|
/* |
||||||
|
* This file is part of the Magallanes package. |
||||||
|
* |
||||||
|
* (c) Andrés Montañez <andres@andresmontanez.com> |
||||||
|
* |
||||||
|
* For the full copyright and license information, please view the LICENSE |
||||||
|
* file that was distributed with this source code. |
||||||
|
*/ |
||||||
|
|
||||||
|
namespace Mage\Tests\Task; |
||||||
|
|
||||||
|
use Mage\Task\AbstractTask; |
||||||
|
|
||||||
|
/** |
||||||
|
* Custom Task for Testing |
||||||
|
* |
||||||
|
* @author Andrés Montañez <andresmontanez@gmail.com> |
||||||
|
*/ |
||||||
|
class CustomTask extends AbstractTask |
||||||
|
{ |
||||||
|
public function getName() |
||||||
|
{ |
||||||
|
return 'custom'; |
||||||
|
} |
||||||
|
|
||||||
|
public function getDescription() |
||||||
|
{ |
||||||
|
return '[Custom] Dummy Task'; |
||||||
|
} |
||||||
|
|
||||||
|
public function execute() |
||||||
|
{ |
||||||
|
return true; |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue