diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-09-09 21:02:03 +0200 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-09-11 21:58:56 +0200 |
commit | b3437d58ae224121375c99e9288d8b808524e624 (patch) | |
tree | 94ce3446aed4396ba9304b8c97e421eba35e4edf /tests/Wallabag/ImportBundle/Controller | |
parent | 7f7531171f6e49110b5842f869e37c766a682473 (diff) | |
download | wallabag-b3437d58ae224121375c99e9288d8b808524e624.tar.gz wallabag-b3437d58ae224121375c99e9288d8b808524e624.tar.zst wallabag-b3437d58ae224121375c99e9288d8b808524e624.zip |
Enable Redis async import
- using javibravo/simpleue
- internal config value are now `import_with_redis` & `import_with_rabbit` which are more clear
- if both option are enable rabbit will be choosen
- services imports related to async are now splitted into 2 files: `redis.yml` & `rabbit.yml`
-
Diffstat (limited to 'tests/Wallabag/ImportBundle/Controller')
4 files changed, 71 insertions, 8 deletions
diff --git a/tests/Wallabag/ImportBundle/Controller/PocketControllerTest.php b/tests/Wallabag/ImportBundle/Controller/PocketControllerTest.php index 098cf356..35673261 100644 --- a/tests/Wallabag/ImportBundle/Controller/PocketControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/PocketControllerTest.php | |||
@@ -22,14 +22,29 @@ class PocketControllerTest extends WallabagCoreTestCase | |||
22 | $this->logInAs('admin'); | 22 | $this->logInAs('admin'); |
23 | $client = $this->getClient(); | 23 | $client = $this->getClient(); |
24 | 24 | ||
25 | $client->getContainer()->get('craue_config')->set('rabbitmq', 1); | 25 | $client->getContainer()->get('craue_config')->set('import_with_rabbitmq', 1); |
26 | 26 | ||
27 | $crawler = $client->request('GET', '/import/pocket'); | 27 | $crawler = $client->request('GET', '/import/pocket'); |
28 | 28 | ||
29 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | 29 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); |
30 | $this->assertEquals(1, $crawler->filter('button[type=submit]')->count()); | 30 | $this->assertEquals(1, $crawler->filter('button[type=submit]')->count()); |
31 | 31 | ||
32 | $client->getContainer()->get('craue_config')->set('rabbitmq', 0); | 32 | $client->getContainer()->get('craue_config')->set('import_with_rabbitmq', 0); |
33 | } | ||
34 | |||
35 | public function testImportPocketWithRedisEnabled() | ||
36 | { | ||
37 | $this->logInAs('admin'); | ||
38 | $client = $this->getClient(); | ||
39 | |||
40 | $client->getContainer()->get('craue_config')->set('import_with_redis', 1); | ||
41 | |||
42 | $crawler = $client->request('GET', '/import/pocket'); | ||
43 | |||
44 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | ||
45 | $this->assertEquals(1, $crawler->filter('button[type=submit]')->count()); | ||
46 | |||
47 | $client->getContainer()->get('craue_config')->set('import_with_redis', 0); | ||
33 | } | 48 | } |
34 | 49 | ||
35 | public function testImportPocketAuthBadToken() | 50 | public function testImportPocketAuthBadToken() |
diff --git a/tests/Wallabag/ImportBundle/Controller/ReadabilityControllerTest.php b/tests/Wallabag/ImportBundle/Controller/ReadabilityControllerTest.php index e12a723d..69635382 100644 --- a/tests/Wallabag/ImportBundle/Controller/ReadabilityControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/ReadabilityControllerTest.php | |||
@@ -24,7 +24,7 @@ class ReadabilityControllerTest extends WallabagCoreTestCase | |||
24 | $this->logInAs('admin'); | 24 | $this->logInAs('admin'); |
25 | $client = $this->getClient(); | 25 | $client = $this->getClient(); |
26 | 26 | ||
27 | $client->getContainer()->get('craue_config')->set('rabbitmq', 1); | 27 | $client->getContainer()->get('craue_config')->set('import_with_rabbitmq', 1); |
28 | 28 | ||
29 | $crawler = $client->request('GET', '/import/readability'); | 29 | $crawler = $client->request('GET', '/import/readability'); |
30 | 30 | ||
@@ -32,7 +32,23 @@ class ReadabilityControllerTest extends WallabagCoreTestCase | |||
32 | $this->assertEquals(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); | 32 | $this->assertEquals(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); |
33 | $this->assertEquals(1, $crawler->filter('input[type=file]')->count()); | 33 | $this->assertEquals(1, $crawler->filter('input[type=file]')->count()); |
34 | 34 | ||
35 | $client->getContainer()->get('craue_config')->set('rabbitmq', 0); | 35 | $client->getContainer()->get('craue_config')->set('import_with_rabbitmq', 0); |
36 | } | ||
37 | |||
38 | public function testImportReadabilityWithRedisEnabled() | ||
39 | { | ||
40 | $this->logInAs('admin'); | ||
41 | $client = $this->getClient(); | ||
42 | |||
43 | $client->getContainer()->get('craue_config')->set('import_with_redis', 1); | ||
44 | |||
45 | $crawler = $client->request('GET', '/import/readability'); | ||
46 | |||
47 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | ||
48 | $this->assertEquals(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); | ||
49 | $this->assertEquals(1, $crawler->filter('input[type=file]')->count()); | ||
50 | |||
51 | $client->getContainer()->get('craue_config')->set('import_with_redis', 0); | ||
36 | } | 52 | } |
37 | 53 | ||
38 | public function testImportReadabilityWithFile() | 54 | public function testImportReadabilityWithFile() |
diff --git a/tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php b/tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php index 96556717..933ddd6c 100644 --- a/tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php | |||
@@ -24,7 +24,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase | |||
24 | $this->logInAs('admin'); | 24 | $this->logInAs('admin'); |
25 | $client = $this->getClient(); | 25 | $client = $this->getClient(); |
26 | 26 | ||
27 | $client->getContainer()->get('craue_config')->set('rabbitmq', 1); | 27 | $client->getContainer()->get('craue_config')->set('import_with_rabbitmq', 1); |
28 | 28 | ||
29 | $crawler = $client->request('GET', '/import/wallabag-v1'); | 29 | $crawler = $client->request('GET', '/import/wallabag-v1'); |
30 | 30 | ||
@@ -32,7 +32,23 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase | |||
32 | $this->assertEquals(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); | 32 | $this->assertEquals(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); |
33 | $this->assertEquals(1, $crawler->filter('input[type=file]')->count()); | 33 | $this->assertEquals(1, $crawler->filter('input[type=file]')->count()); |
34 | 34 | ||
35 | $client->getContainer()->get('craue_config')->set('rabbitmq', 0); | 35 | $client->getContainer()->get('craue_config')->set('import_with_rabbitmq', 0); |
36 | } | ||
37 | |||
38 | public function testImportWallabagWithRedisEnabled() | ||
39 | { | ||
40 | $this->logInAs('admin'); | ||
41 | $client = $this->getClient(); | ||
42 | |||
43 | $client->getContainer()->get('craue_config')->set('import_with_redis', 1); | ||
44 | |||
45 | $crawler = $client->request('GET', '/import/wallabag-v1'); | ||
46 | |||
47 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | ||
48 | $this->assertEquals(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); | ||
49 | $this->assertEquals(1, $crawler->filter('input[type=file]')->count()); | ||
50 | |||
51 | $client->getContainer()->get('craue_config')->set('import_with_redis', 0); | ||
36 | } | 52 | } |
37 | 53 | ||
38 | public function testImportWallabagWithFile() | 54 | public function testImportWallabagWithFile() |
diff --git a/tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php b/tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php index 250d0d3e..36e5221d 100644 --- a/tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php | |||
@@ -24,7 +24,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase | |||
24 | $this->logInAs('admin'); | 24 | $this->logInAs('admin'); |
25 | $client = $this->getClient(); | 25 | $client = $this->getClient(); |
26 | 26 | ||
27 | $client->getContainer()->get('craue_config')->set('rabbitmq', 1); | 27 | $client->getContainer()->get('craue_config')->set('import_with_rabbitmq', 1); |
28 | 28 | ||
29 | $crawler = $client->request('GET', '/import/wallabag-v2'); | 29 | $crawler = $client->request('GET', '/import/wallabag-v2'); |
30 | 30 | ||
@@ -32,7 +32,23 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase | |||
32 | $this->assertEquals(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); | 32 | $this->assertEquals(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); |
33 | $this->assertEquals(1, $crawler->filter('input[type=file]')->count()); | 33 | $this->assertEquals(1, $crawler->filter('input[type=file]')->count()); |
34 | 34 | ||
35 | $client->getContainer()->get('craue_config')->set('rabbitmq', 0); | 35 | $client->getContainer()->get('craue_config')->set('import_with_rabbitmq', 0); |
36 | } | ||
37 | |||
38 | public function testImportWallabagWithRedisEnabled() | ||
39 | { | ||
40 | $this->logInAs('admin'); | ||
41 | $client = $this->getClient(); | ||
42 | |||
43 | $client->getContainer()->get('craue_config')->set('import_with_redis', 1); | ||
44 | |||
45 | $crawler = $client->request('GET', '/import/wallabag-v2'); | ||
46 | |||
47 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | ||
48 | $this->assertEquals(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); | ||
49 | $this->assertEquals(1, $crawler->filter('input[type=file]')->count()); | ||
50 | |||
51 | $client->getContainer()->get('craue_config')->set('import_with_redis', 0); | ||
36 | } | 52 | } |
37 | 53 | ||
38 | public function testImportWallabagWithFile() | 54 | public function testImportWallabagWithFile() |