aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Wallabag/CoreBundle
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Wallabag/CoreBundle')
-rw-r--r--tests/Wallabag/CoreBundle/Command/InstallCommandTest.php6
-rw-r--r--tests/Wallabag/CoreBundle/Controller/DeveloperControllerTest.php9
-rw-r--r--tests/Wallabag/CoreBundle/EventListener/LocaleListenerTest.php6
3 files changed, 13 insertions, 8 deletions
diff --git a/tests/Wallabag/CoreBundle/Command/InstallCommandTest.php b/tests/Wallabag/CoreBundle/Command/InstallCommandTest.php
index 089a1c5f..c0133af4 100644
--- a/tests/Wallabag/CoreBundle/Command/InstallCommandTest.php
+++ b/tests/Wallabag/CoreBundle/Command/InstallCommandTest.php
@@ -87,7 +87,6 @@ class InstallCommandTest extends WallabagCoreTestCase
87 $this->assertContains('Setting up database.', $tester->getDisplay()); 87 $this->assertContains('Setting up database.', $tester->getDisplay());
88 $this->assertContains('Administration setup.', $tester->getDisplay()); 88 $this->assertContains('Administration setup.', $tester->getDisplay());
89 $this->assertContains('Config setup.', $tester->getDisplay()); 89 $this->assertContains('Config setup.', $tester->getDisplay());
90 $this->assertContains('Installing assets.', $tester->getDisplay());
91 } 90 }
92 91
93 public function testRunInstallCommandWithReset() 92 public function testRunInstallCommandWithReset()
@@ -119,7 +118,6 @@ class InstallCommandTest extends WallabagCoreTestCase
119 $this->assertContains('Droping database, creating database and schema, clearing the cache', $tester->getDisplay()); 118 $this->assertContains('Droping database, creating database and schema, clearing the cache', $tester->getDisplay());
120 $this->assertContains('Administration setup.', $tester->getDisplay()); 119 $this->assertContains('Administration setup.', $tester->getDisplay());
121 $this->assertContains('Config setup.', $tester->getDisplay()); 120 $this->assertContains('Config setup.', $tester->getDisplay());
122 $this->assertContains('Installing assets.', $tester->getDisplay());
123 121
124 // we force to reset everything 122 // we force to reset everything
125 $this->assertContains('Droping database, creating database and schema, clearing the cache', $tester->getDisplay()); 123 $this->assertContains('Droping database, creating database and schema, clearing the cache', $tester->getDisplay());
@@ -164,7 +162,6 @@ class InstallCommandTest extends WallabagCoreTestCase
164 $this->assertContains('Setting up database.', $tester->getDisplay()); 162 $this->assertContains('Setting up database.', $tester->getDisplay());
165 $this->assertContains('Administration setup.', $tester->getDisplay()); 163 $this->assertContains('Administration setup.', $tester->getDisplay());
166 $this->assertContains('Config setup.', $tester->getDisplay()); 164 $this->assertContains('Config setup.', $tester->getDisplay());
167 $this->assertContains('Installing assets.', $tester->getDisplay());
168 165
169 // the current database doesn't already exist 166 // the current database doesn't already exist
170 $this->assertContains('Creating database and schema, clearing the cache', $tester->getDisplay()); 167 $this->assertContains('Creating database and schema, clearing the cache', $tester->getDisplay());
@@ -202,7 +199,6 @@ class InstallCommandTest extends WallabagCoreTestCase
202 $this->assertContains('Setting up database.', $tester->getDisplay()); 199 $this->assertContains('Setting up database.', $tester->getDisplay());
203 $this->assertContains('Administration setup.', $tester->getDisplay()); 200 $this->assertContains('Administration setup.', $tester->getDisplay());
204 $this->assertContains('Config setup.', $tester->getDisplay()); 201 $this->assertContains('Config setup.', $tester->getDisplay());
205 $this->assertContains('Installing assets.', $tester->getDisplay());
206 202
207 $this->assertContains('Droping schema and creating schema', $tester->getDisplay()); 203 $this->assertContains('Droping schema and creating schema', $tester->getDisplay());
208 } 204 }
@@ -257,7 +253,6 @@ class InstallCommandTest extends WallabagCoreTestCase
257 $this->assertContains('Setting up database.', $tester->getDisplay()); 253 $this->assertContains('Setting up database.', $tester->getDisplay());
258 $this->assertContains('Administration setup.', $tester->getDisplay()); 254 $this->assertContains('Administration setup.', $tester->getDisplay());
259 $this->assertContains('Config setup.', $tester->getDisplay()); 255 $this->assertContains('Config setup.', $tester->getDisplay());
260 $this->assertContains('Installing assets.', $tester->getDisplay());
261 256
262 $this->assertContains('Creating schema', $tester->getDisplay()); 257 $this->assertContains('Creating schema', $tester->getDisplay());
263 } 258 }
@@ -290,6 +285,5 @@ class InstallCommandTest extends WallabagCoreTestCase
290 $this->assertContains('Setting up database.', $tester->getDisplay()); 285 $this->assertContains('Setting up database.', $tester->getDisplay());
291 $this->assertContains('Administration setup.', $tester->getDisplay()); 286 $this->assertContains('Administration setup.', $tester->getDisplay());
292 $this->assertContains('Config setup.', $tester->getDisplay()); 287 $this->assertContains('Config setup.', $tester->getDisplay());
293 $this->assertContains('Installing assets.', $tester->getDisplay());
294 } 288 }
295} 289}
diff --git a/tests/Wallabag/CoreBundle/Controller/DeveloperControllerTest.php b/tests/Wallabag/CoreBundle/Controller/DeveloperControllerTest.php
index 79452ace..97ed0d58 100644
--- a/tests/Wallabag/CoreBundle/Controller/DeveloperControllerTest.php
+++ b/tests/Wallabag/CoreBundle/Controller/DeveloperControllerTest.php
@@ -18,12 +18,19 @@ class DeveloperControllerTest extends WallabagCoreTestCase
18 18
19 $form = $crawler->filter('button[type=submit]')->form(); 19 $form = $crawler->filter('button[type=submit]')->form();
20 20
21 $client->submit($form); 21 $data = [
22 'client[name]' => 'My app',
23 ];
24
25 $crawler = $client->submit($form, $data);
22 26
23 $this->assertEquals(200, $client->getResponse()->getStatusCode()); 27 $this->assertEquals(200, $client->getResponse()->getStatusCode());
24 28
25 $newNbClients = $em->getRepository('WallabagApiBundle:Client')->findAll(); 29 $newNbClients = $em->getRepository('WallabagApiBundle:Client')->findAll();
26 $this->assertGreaterThan(count($nbClients), count($newNbClients)); 30 $this->assertGreaterThan(count($nbClients), count($newNbClients));
31
32 $this->assertGreaterThan(1, $alert = $crawler->filter('.settings ul li strong')->extract(['_text']));
33 $this->assertContains('My app', $alert[0]);
27 } 34 }
28 35
29 public function testListingClient() 36 public function testListingClient()
diff --git a/tests/Wallabag/CoreBundle/EventListener/LocaleListenerTest.php b/tests/Wallabag/CoreBundle/EventListener/LocaleListenerTest.php
index 2a7f9390..078bb69a 100644
--- a/tests/Wallabag/CoreBundle/EventListener/LocaleListenerTest.php
+++ b/tests/Wallabag/CoreBundle/EventListener/LocaleListenerTest.php
@@ -15,7 +15,11 @@ class LocaleListenerTest extends \PHPUnit_Framework_TestCase
15{ 15{
16 private function getEvent(Request $request) 16 private function getEvent(Request $request)
17 { 17 {
18 return new GetResponseEvent($this->getMock('Symfony\Component\HttpKernel\HttpKernelInterface'), $request, HttpKernelInterface::MASTER_REQUEST); 18 $kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\HttpKernelInterface')
19 ->disableOriginalConstructor()
20 ->getMock();
21
22 return new GetResponseEvent($kernel, $request, HttpKernelInterface::MASTER_REQUEST);
19 } 23 }
20 24
21 public function testWithoutSession() 25 public function testWithoutSession()