]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - tests/Wallabag/CoreBundle/Controller/RssControllerTest.php
Merge remote-tracking branch 'origin/master' into 2.4
[github/wallabag/wallabag.git] / tests / Wallabag / CoreBundle / Controller / RssControllerTest.php
index 6167fe2dbf82d2a880f0f34ca5f397b181297351..afa906210f0edf2945f5772b33c2316be13b7435 100644 (file)
@@ -11,7 +11,7 @@ class RssControllerTest extends WallabagCoreTestCase
         $doc = new \DOMDocument();
         $doc->loadXML($xml);
 
-        $xpath = new \DOMXpath($doc);
+        $xpath = new \DOMXPath($doc);
 
         if (null === $nb) {
             $this->assertGreaterThan(0, $xpath->query('//item')->length);
@@ -61,6 +61,9 @@ class RssControllerTest extends WallabagCoreTestCase
             [
                 '/wallace/YZIOAUZIAO/archives.xml',
             ],
+            [
+                '/wallace/YZIOAUZIAO/all.xml',
+            ],
         ];
     }
 
@@ -141,6 +144,28 @@ class RssControllerTest extends WallabagCoreTestCase
         $this->validateDom($client->getResponse()->getContent(), 'archive', 'archive');
     }
 
+    public function testAll()
+    {
+        $client = $this->getClient();
+        $em = $client->getContainer()->get('doctrine.orm.entity_manager');
+        $user = $em
+            ->getRepository('WallabagUserBundle:User')
+            ->findOneByUsername('admin');
+
+        $config = $user->getConfig();
+        $config->setRssToken('SUPERTOKEN');
+        $config->setRssLimit(null);
+        $em->persist($config);
+        $em->flush();
+
+        $client = $this->getClient();
+        $client->request('GET', '/admin/SUPERTOKEN/all.xml');
+
+        $this->assertSame(200, $client->getResponse()->getStatusCode());
+
+        $this->validateDom($client->getResponse()->getContent(), 'all', 'all');
+    }
+
     public function testPagination()
     {
         $client = $this->getClient();
@@ -184,13 +209,13 @@ class RssControllerTest extends WallabagCoreTestCase
         $em->flush();
 
         $client = $this->getClient();
-        $client->request('GET', '/admin/SUPERTOKEN/tags/foo-bar.xml');
+        $client->request('GET', '/admin/SUPERTOKEN/tags/foo.xml');
 
         $this->assertSame(200, $client->getResponse()->getStatusCode());
 
-        $this->validateDom($client->getResponse()->getContent(), 'tag (foo bar)', 'tags/foo-bar');
+        $this->validateDom($client->getResponse()->getContent(), 'tag (foo)', 'tags/foo');
 
-        $client->request('GET', '/admin/SUPERTOKEN/tags/foo-bar.xml?page=3000');
+        $client->request('GET', '/admin/SUPERTOKEN/tags/foo.xml?page=3000');
         $this->assertSame(302, $client->getResponse()->getStatusCode());
     }
 }