Skip to content

Commit

Permalink
Fixed the code of the EmptyBackendTest
Browse files Browse the repository at this point in the history
  • Loading branch information
javiereguiluz committed May 21, 2015
1 parent 6be36a1 commit 1182fcd
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Tests/Controller/EmptyBackendTest.php
Expand Up @@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/

namespace JavierEguiluz\Bundle\EasyAdminBundle\Tests\Configuration;
namespace JavierEguiluz\Bundle\EasyAdminBundle\Tests\Controller;

use JavierEguiluz\Bundle\EasyAdminBundle\Tests\Fixtures\AbstractTestCase;

Expand All @@ -18,9 +18,14 @@ class EmptyBackendTest extends AbstractTestCase
public function testNoEntityHasBennConfigured()
{
$this->initClient(array('environment' => 'empty_backend'));
$this->getBackendHomepage();
$this->client->request('GET', '/admin');

$this->assertEquals(301, $this->client->getResponse()->getStatusCode());
$this->assertEquals('http://localhost/admin/', $this->client->getResponse()->headers->get('Location'));

$crawler = $this->client->followRedirect();

$this->assertEquals(404, $this->client->getResponse()->getStatusCode());
$this->assertEquals("Your backend is empty because you haven't configured\n any Doctrine entity to manage.", trim($this->client->getCrawler()->filter('body.error .container .error-problem p.lead')->text()));
$this->assertEquals("Your backend is empty because you haven't configured\n any Doctrine entity to manage.", trim($crawler->filter('body.error .container .error-problem p.lead')->text()));
}
}

0 comments on commit 1182fcd

Please sign in to comment.