]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - tests/Wallabag/ImportBundle/Controller/PocketControllerTest.php
Merge pull request #2306 from wallabag/redis-rabbit-check
[github/wallabag/wallabag.git] / tests / Wallabag / ImportBundle / Controller / PocketControllerTest.php
index e0e61df88c43d5d5161128a261738bf9385c0e69..7d6a300fb3fbdce2f7091a41f19e0e3fb4d04592 100644 (file)
@@ -17,6 +17,37 @@ class PocketControllerTest extends WallabagCoreTestCase
         $this->assertEquals(1, $crawler->filter('button[type=submit]')->count());
     }
 
+    public function testImportPocketWithRabbitEnabled()
+    {
+        $this->logInAs('admin');
+        $client = $this->getClient();
+
+        $client->getContainer()->get('craue_config')->set('import_with_rabbitmq', 1);
+
+        $crawler = $client->request('GET', '/import/pocket');
+
+        $this->assertEquals(200, $client->getResponse()->getStatusCode());
+        $this->assertEquals(1, $crawler->filter('button[type=submit]')->count());
+
+        $client->getContainer()->get('craue_config')->set('import_with_rabbitmq', 0);
+    }
+
+    public function testImportPocketWithRedisEnabled()
+    {
+        $this->checkRedis();
+        $this->logInAs('admin');
+        $client = $this->getClient();
+
+        $client->getContainer()->get('craue_config')->set('import_with_redis', 1);
+
+        $crawler = $client->request('GET', '/import/pocket');
+
+        $this->assertEquals(200, $client->getResponse()->getStatusCode());
+        $this->assertEquals(1, $crawler->filter('button[type=submit]')->count());
+
+        $client->getContainer()->get('craue_config')->set('import_with_redis', 0);
+    }
+
     public function testImportPocketAuthBadToken()
     {
         $this->logInAs('admin');