From fc955e299537decb28b99de8557b003177f304d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 25 Nov 2014 15:07:02 +0100 Subject: [PATCH] Replace search link on main page to point to chill_main_search and fix tests --- Resources/views/Login/login.html.twig | 2 +- Resources/views/layout.html.twig | 2 +- Tests/Controller/LoginControllerTest.php | 14 +++++++++++--- Tests/Fixtures/App/config/config.yml | 4 ++-- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Resources/views/Login/login.html.twig b/Resources/views/Login/login.html.twig index 35b9f3703..64582e0af 100644 --- a/Resources/views/Login/login.html.twig +++ b/Resources/views/Login/login.html.twig @@ -35,7 +35,7 @@
- + diff --git a/Resources/views/layout.html.twig b/Resources/views/layout.html.twig index 66c6c41a7..44d6c105d 100644 --- a/Resources/views/layout.html.twig +++ b/Resources/views/layout.html.twig @@ -100,7 +100,7 @@

{{ 'Search a person'|trans }}

-
+
diff --git a/Tests/Controller/LoginControllerTest.php b/Tests/Controller/LoginControllerTest.php index 682cadf3b..a7d161dd8 100644 --- a/Tests/Controller/LoginControllerTest.php +++ b/Tests/Controller/LoginControllerTest.php @@ -9,13 +9,21 @@ class LoginControllerTest extends WebTestCase { public function testLogin() { - $client = static::createClient(); + $client = static::createClient(array( + 'framework' => array( + 'default_locale' => 'en', + 'translator' => array( + 'fallback' => 'en' + ) + ), + + )); //load login page and submit form $crawler = $client->request('GET', '/login'); $this->assertTrue($client->getResponse()->isSuccessful()); - $buttonCrawlerNode = $crawler->selectButton('Login'); + $buttonCrawlerNode = $crawler->selectButton('login'); $form = $buttonCrawlerNode->form(); $client->submit($form, array( @@ -40,7 +48,7 @@ class LoginControllerTest extends WebTestCase $logoutLinkFilter = $crawler->filter('a:contains("Logout")'); //check there is > 0 logout link - $this->assertGreaterThan(0, $logoutLinkFilter->count()); + $this->assertGreaterThan(0, $logoutLinkFilter->count(), 'check that a logout link is present'); //click on logout link $client->followRedirects(false); diff --git a/Tests/Fixtures/App/config/config.yml b/Tests/Fixtures/App/config/config.yml index 4f378c3c6..dadcba67a 100644 --- a/Tests/Fixtures/App/config/config.yml +++ b/Tests/Fixtures/App/config/config.yml @@ -7,8 +7,8 @@ framework: form: true csrf_protection: true session: ~ - default_locale: fr - translator: { fallback: fr } + default_locale: en + translator: { fallback: en } profiler: { only_exceptions: false } templating: engines: ['twig']