aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Wallabag/CoreBundle/Controller/RssControllerTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Wallabag/CoreBundle/Controller/RssControllerTest.php')
-rw-r--r--tests/Wallabag/CoreBundle/Controller/RssControllerTest.php58
1 files changed, 29 insertions, 29 deletions
diff --git a/tests/Wallabag/CoreBundle/Controller/RssControllerTest.php b/tests/Wallabag/CoreBundle/Controller/RssControllerTest.php
index 530c8bbf..6167fe2d 100644
--- a/tests/Wallabag/CoreBundle/Controller/RssControllerTest.php
+++ b/tests/Wallabag/CoreBundle/Controller/RssControllerTest.php
@@ -16,36 +16,36 @@ class RssControllerTest extends WallabagCoreTestCase
16 if (null === $nb) { 16 if (null === $nb) {
17 $this->assertGreaterThan(0, $xpath->query('//item')->length); 17 $this->assertGreaterThan(0, $xpath->query('//item')->length);
18 } else { 18 } else {
19 $this->assertEquals($nb, $xpath->query('//item')->length); 19 $this->assertSame($nb, $xpath->query('//item')->length);
20 } 20 }
21 21
22 $this->assertEquals(1, $xpath->query('/rss')->length); 22 $this->assertSame(1, $xpath->query('/rss')->length);
23 $this->assertEquals(1, $xpath->query('/rss/channel')->length); 23 $this->assertSame(1, $xpath->query('/rss/channel')->length);
24 24
25 $this->assertEquals(1, $xpath->query('/rss/channel/title')->length); 25 $this->assertSame(1, $xpath->query('/rss/channel/title')->length);
26 $this->assertEquals('wallabag - '.$type.' feed', $xpath->query('/rss/channel/title')->item(0)->nodeValue); 26 $this->assertSame('wallabag - ' . $type . ' feed', $xpath->query('/rss/channel/title')->item(0)->nodeValue);
27 27
28 $this->assertEquals(1, $xpath->query('/rss/channel/pubDate')->length); 28 $this->assertSame(1, $xpath->query('/rss/channel/pubDate')->length);
29 29
30 $this->assertEquals(1, $xpath->query('/rss/channel/generator')->length); 30 $this->assertSame(1, $xpath->query('/rss/channel/generator')->length);
31 $this->assertEquals('wallabag', $xpath->query('/rss/channel/generator')->item(0)->nodeValue); 31 $this->assertSame('wallabag', $xpath->query('/rss/channel/generator')->item(0)->nodeValue);
32 32
33 $this->assertEquals(1, $xpath->query('/rss/channel/description')->length); 33 $this->assertSame(1, $xpath->query('/rss/channel/description')->length);
34 $this->assertEquals('wallabag '.$type.' elements', $xpath->query('/rss/channel/description')->item(0)->nodeValue); 34 $this->assertSame('wallabag ' . $type . ' elements', $xpath->query('/rss/channel/description')->item(0)->nodeValue);
35 35
36 $this->assertEquals(1, $xpath->query('/rss/channel/link[@rel="self"]')->length); 36 $this->assertSame(1, $xpath->query('/rss/channel/link[@rel="self"]')->length);
37 $this->assertContains($urlPagination.'.xml', $xpath->query('/rss/channel/link[@rel="self"]')->item(0)->getAttribute('href')); 37 $this->assertContains($urlPagination . '.xml', $xpath->query('/rss/channel/link[@rel="self"]')->item(0)->getAttribute('href'));
38 38
39 $this->assertEquals(1, $xpath->query('/rss/channel/link[@rel="last"]')->length); 39 $this->assertSame(1, $xpath->query('/rss/channel/link[@rel="last"]')->length);
40 $this->assertContains($urlPagination.'.xml?page=', $xpath->query('/rss/channel/link[@rel="last"]')->item(0)->getAttribute('href')); 40 $this->assertContains($urlPagination . '.xml?page=', $xpath->query('/rss/channel/link[@rel="last"]')->item(0)->getAttribute('href'));
41 41
42 foreach ($xpath->query('//item') as $item) { 42 foreach ($xpath->query('//item') as $item) {
43 $this->assertEquals(1, $xpath->query('title', $item)->length); 43 $this->assertSame(1, $xpath->query('title', $item)->length);
44 $this->assertEquals(1, $xpath->query('source', $item)->length); 44 $this->assertSame(1, $xpath->query('source', $item)->length);
45 $this->assertEquals(1, $xpath->query('link', $item)->length); 45 $this->assertSame(1, $xpath->query('link', $item)->length);
46 $this->assertEquals(1, $xpath->query('guid', $item)->length); 46 $this->assertSame(1, $xpath->query('guid', $item)->length);
47 $this->assertEquals(1, $xpath->query('pubDate', $item)->length); 47 $this->assertSame(1, $xpath->query('pubDate', $item)->length);
48 $this->assertEquals(1, $xpath->query('description', $item)->length); 48 $this->assertSame(1, $xpath->query('description', $item)->length);
49 } 49 }
50 } 50 }
51 51
@@ -73,7 +73,7 @@ class RssControllerTest extends WallabagCoreTestCase
73 73
74 $client->request('GET', $url); 74 $client->request('GET', $url);
75 75
76 $this->assertEquals(404, $client->getResponse()->getStatusCode()); 76 $this->assertSame(404, $client->getResponse()->getStatusCode());
77 } 77 }
78 78
79 public function testUnread() 79 public function testUnread()
@@ -92,7 +92,7 @@ class RssControllerTest extends WallabagCoreTestCase
92 92
93 $client->request('GET', '/admin/SUPERTOKEN/unread.xml'); 93 $client->request('GET', '/admin/SUPERTOKEN/unread.xml');
94 94
95 $this->assertEquals(200, $client->getResponse()->getStatusCode()); 95 $this->assertSame(200, $client->getResponse()->getStatusCode());
96 96
97 $this->validateDom($client->getResponse()->getContent(), 'unread', 'unread', 2); 97 $this->validateDom($client->getResponse()->getContent(), 'unread', 'unread', 2);
98 } 98 }
@@ -114,7 +114,7 @@ class RssControllerTest extends WallabagCoreTestCase
114 $client = $this->getClient(); 114 $client = $this->getClient();
115 $client->request('GET', '/admin/SUPERTOKEN/starred.xml'); 115 $client->request('GET', '/admin/SUPERTOKEN/starred.xml');
116 116
117 $this->assertEquals(200, $client->getResponse()->getStatusCode(), 1); 117 $this->assertSame(200, $client->getResponse()->getStatusCode(), 1);
118 118
119 $this->validateDom($client->getResponse()->getContent(), 'starred', 'starred'); 119 $this->validateDom($client->getResponse()->getContent(), 'starred', 'starred');
120 } 120 }
@@ -136,7 +136,7 @@ class RssControllerTest extends WallabagCoreTestCase
136 $client = $this->getClient(); 136 $client = $this->getClient();
137 $client->request('GET', '/admin/SUPERTOKEN/archive.xml'); 137 $client->request('GET', '/admin/SUPERTOKEN/archive.xml');
138 138
139 $this->assertEquals(200, $client->getResponse()->getStatusCode()); 139 $this->assertSame(200, $client->getResponse()->getStatusCode());
140 140
141 $this->validateDom($client->getResponse()->getContent(), 'archive', 'archive'); 141 $this->validateDom($client->getResponse()->getContent(), 'archive', 'archive');
142 } 142 }
@@ -158,15 +158,15 @@ class RssControllerTest extends WallabagCoreTestCase
158 $client = $this->getClient(); 158 $client = $this->getClient();
159 159
160 $client->request('GET', '/admin/SUPERTOKEN/unread.xml'); 160 $client->request('GET', '/admin/SUPERTOKEN/unread.xml');
161 $this->assertEquals(200, $client->getResponse()->getStatusCode()); 161 $this->assertSame(200, $client->getResponse()->getStatusCode());
162 $this->validateDom($client->getResponse()->getContent(), 'unread', 'unread'); 162 $this->validateDom($client->getResponse()->getContent(), 'unread', 'unread');
163 163
164 $client->request('GET', '/admin/SUPERTOKEN/unread.xml?page=2'); 164 $client->request('GET', '/admin/SUPERTOKEN/unread.xml?page=2');
165 $this->assertEquals(200, $client->getResponse()->getStatusCode()); 165 $this->assertSame(200, $client->getResponse()->getStatusCode());
166 $this->validateDom($client->getResponse()->getContent(), 'unread', 'unread'); 166 $this->validateDom($client->getResponse()->getContent(), 'unread', 'unread');
167 167
168 $client->request('GET', '/admin/SUPERTOKEN/unread.xml?page=3000'); 168 $client->request('GET', '/admin/SUPERTOKEN/unread.xml?page=3000');
169 $this->assertEquals(302, $client->getResponse()->getStatusCode()); 169 $this->assertSame(302, $client->getResponse()->getStatusCode());
170 } 170 }
171 171
172 public function testTags() 172 public function testTags()
@@ -186,11 +186,11 @@ class RssControllerTest extends WallabagCoreTestCase
186 $client = $this->getClient(); 186 $client = $this->getClient();
187 $client->request('GET', '/admin/SUPERTOKEN/tags/foo-bar.xml'); 187 $client->request('GET', '/admin/SUPERTOKEN/tags/foo-bar.xml');
188 188
189 $this->assertEquals(200, $client->getResponse()->getStatusCode()); 189 $this->assertSame(200, $client->getResponse()->getStatusCode());
190 190
191 $this->validateDom($client->getResponse()->getContent(), 'tag (foo bar)', 'tags/foo-bar'); 191 $this->validateDom($client->getResponse()->getContent(), 'tag (foo bar)', 'tags/foo-bar');
192 192
193 $client->request('GET', '/admin/SUPERTOKEN/tags/foo-bar.xml?page=3000'); 193 $client->request('GET', '/admin/SUPERTOKEN/tags/foo-bar.xml?page=3000');
194 $this->assertEquals(302, $client->getResponse()->getStatusCode()); 194 $this->assertSame(302, $client->getResponse()->getStatusCode());
195 } 195 }
196} 196}