mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-16 06:23:18 +00:00
52 lines
1.4 KiB
PHP
52 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace Alchemy\Tests\Phrasea\Application;
|
|
|
|
use Alchemy\Phrasea\Application;
|
|
|
|
/**
|
|
* @group functional
|
|
* @group legacy
|
|
*/
|
|
class RootApplicationTest extends \PhraseanetTestCase
|
|
{
|
|
/**
|
|
* @dataProvider provideEnvironments
|
|
*/
|
|
public function testApplicationIsBuiltWithTheRightEnv($environment)
|
|
{
|
|
$app = require __DIR__ . '/../../../../../lib/Alchemy/Phrasea/Application/Root.php';
|
|
$this->assertEquals($environment, $app->getEnvironment());
|
|
}
|
|
|
|
public function provideEnvironments()
|
|
{
|
|
return [
|
|
[Application::ENV_PROD],
|
|
[Application::ENV_TEST],
|
|
[Application::ENV_DEV],
|
|
];
|
|
}
|
|
|
|
public function testWebProfilerDisableInProdEnv()
|
|
{
|
|
$environment = Application::ENV_PROD;
|
|
$app = require __DIR__ . '/../../../../../lib/Alchemy/Phrasea/Application/Root.php';
|
|
$this->assertFalse(isset($app['profiler']));
|
|
}
|
|
|
|
public function testWebProfilerDisableInTestEnv()
|
|
{
|
|
$environment = Application::ENV_TEST;
|
|
$app = require __DIR__ . '/../../../../../lib/Alchemy/Phrasea/Application/Root.php';
|
|
$this->assertFalse(isset($app['profiler']));
|
|
}
|
|
|
|
public function testWebProfilerEnableInDevMode()
|
|
{
|
|
$environment = Application::ENV_DEV;
|
|
$app = require __DIR__ . '/../../../../../lib/Alchemy/Phrasea/Application/Root.php';
|
|
$this->assertTrue(isset($app['profiler']));
|
|
}
|
|
}
|