mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-12 20:43:25 +00:00
50 lines
1.5 KiB
PHP
50 lines
1.5 KiB
PHP
<?php
|
|
|
|
require_once __DIR__ . '/../../../../PhraseanetWebTestCaseAbstract.class.inc';
|
|
|
|
class ControllerInstallerTest extends \PhraseanetWebTestCaseAbstract
|
|
{
|
|
|
|
protected static function loadApplication()
|
|
{
|
|
$environment = 'test';
|
|
return self::$application = require __DIR__ . '/FakeSetupApplication.inc';
|
|
}
|
|
|
|
/**
|
|
* Default route test
|
|
*/
|
|
public function testRouteSlash()
|
|
{
|
|
$this->client->request('GET', '/');
|
|
|
|
$response = $this->client->getResponse();
|
|
/* @var $response \Symfony\Component\HttpFoundation\Response */
|
|
|
|
$this->assertEquals(302, $response->getStatusCode());
|
|
$this->assertEquals('/setup/installer/', $response->headers->get('location'));
|
|
}
|
|
|
|
public function testRouteInstaller()
|
|
{
|
|
$this->client->request('GET', '/installer/');
|
|
|
|
$response = $this->client->getResponse();
|
|
/* @var $response \Symfony\Component\HttpFoundation\Response */
|
|
|
|
$this->assertEquals(302, $response->getStatusCode(), "test that response is a redirection " . $this->client->getResponse()->getContent());
|
|
$this->assertEquals('/setup/installer/step2/', $response->headers->get('location'));
|
|
}
|
|
|
|
public function testRouteInstallerStep2()
|
|
{
|
|
$this->client->request('GET', '/installer/step2/');
|
|
|
|
$response = $this->client->getResponse();
|
|
/* @var $response \Symfony\Component\HttpFoundation\Response */
|
|
|
|
$this->assertEquals(200, $response->getStatusCode());
|
|
$this->assertTrue($response->isOk());
|
|
}
|
|
}
|