diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2017-05-03 11:53:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-03 11:53:01 +0200 |
commit | 9c09c253fea8d618f1be110677a1a9c76e3afdcd (patch) | |
tree | 37c00c043d2ead9e49f93fa3e1544d3d4aceffda /tests/Wallabag/CoreBundle | |
parent | dfa0822f197991f96d427112c23abd460198817d (diff) | |
parent | a162b1a99b0bd4ccebbd129170d043a621bed710 (diff) | |
download | wallabag-9c09c253fea8d618f1be110677a1a9c76e3afdcd.tar.gz wallabag-9c09c253fea8d618f1be110677a1a9c76e3afdcd.tar.zst wallabag-9c09c253fea8d618f1be110677a1a9c76e3afdcd.zip |
Merge pull request #3047 from wallabag/add-notmatches-operator
Added notmatches operator for tagging rule
Diffstat (limited to 'tests/Wallabag/CoreBundle')
3 files changed, 8 insertions, 10 deletions
diff --git a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php index d26a56f8..35438c83 100644 --- a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php | |||
@@ -270,7 +270,7 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
270 | ->findOneByUrl($url); | 270 | ->findOneByUrl($url); |
271 | $tags = $entry->getTags(); | 271 | $tags = $entry->getTags(); |
272 | 272 | ||
273 | $this->assertCount(1, $tags); | 273 | $this->assertCount(2, $tags); |
274 | $this->assertEquals('wallabag', $tags[0]->getLabel()); | 274 | $this->assertEquals('wallabag', $tags[0]->getLabel()); |
275 | 275 | ||
276 | $em->remove($entry); | 276 | $em->remove($entry); |
@@ -299,8 +299,8 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
299 | 299 | ||
300 | $tags = $entry->getTags(); | 300 | $tags = $entry->getTags(); |
301 | 301 | ||
302 | $this->assertCount(1, $tags); | 302 | $this->assertCount(2, $tags); |
303 | $this->assertEquals('wallabag', $tags[0]->getLabel()); | 303 | $this->assertEquals('wallabag', $tags[1]->getLabel()); |
304 | 304 | ||
305 | $em->remove($entry); | 305 | $em->remove($entry); |
306 | $em->flush(); | 306 | $em->flush(); |
diff --git a/tests/Wallabag/CoreBundle/Controller/ExportControllerTest.php b/tests/Wallabag/CoreBundle/Controller/ExportControllerTest.php index 32a18e26..63f2c829 100644 --- a/tests/Wallabag/CoreBundle/Controller/ExportControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/ExportControllerTest.php | |||
@@ -189,11 +189,9 @@ class ExportControllerTest extends WallabagCoreTestCase | |||
189 | $this->assertContains($contentInDB[0]['language'], $csv[1]); | 189 | $this->assertContains($contentInDB[0]['language'], $csv[1]); |
190 | $this->assertContains($contentInDB[0]['createdAt']->format('d/m/Y h:i:s'), $csv[1]); | 190 | $this->assertContains($contentInDB[0]['createdAt']->format('d/m/Y h:i:s'), $csv[1]); |
191 | 191 | ||
192 | $expectedTag = []; | ||
193 | foreach ($contentInDB[0]['tags'] as $tag) { | 192 | foreach ($contentInDB[0]['tags'] as $tag) { |
194 | $expectedTag[] = $tag['label']; | 193 | $this->assertContains($tag['label'], $csv[1]); |
195 | } | 194 | } |
196 | $this->assertContains(implode(', ', $expectedTag), $csv[1]); | ||
197 | } | 195 | } |
198 | 196 | ||
199 | public function testJsonExport() | 197 | public function testJsonExport() |
@@ -241,7 +239,7 @@ class ExportControllerTest extends WallabagCoreTestCase | |||
241 | $this->assertEquals($contentInDB->getLanguage(), $content[0]['language']); | 239 | $this->assertEquals($contentInDB->getLanguage(), $content[0]['language']); |
242 | $this->assertEquals($contentInDB->getReadingtime(), $content[0]['reading_time']); | 240 | $this->assertEquals($contentInDB->getReadingtime(), $content[0]['reading_time']); |
243 | $this->assertEquals($contentInDB->getDomainname(), $content[0]['domain_name']); | 241 | $this->assertEquals($contentInDB->getDomainname(), $content[0]['domain_name']); |
244 | $this->assertEquals(['foo bar', 'baz'], $content[0]['tags']); | 242 | $this->assertEquals(['foo bar', 'baz', 'foot'], $content[0]['tags']); |
245 | } | 243 | } |
246 | 244 | ||
247 | public function testXmlExport() | 245 | public function testXmlExport() |
diff --git a/tests/Wallabag/CoreBundle/Controller/TagControllerTest.php b/tests/Wallabag/CoreBundle/Controller/TagControllerTest.php index fa1a3539..c3b22dcd 100644 --- a/tests/Wallabag/CoreBundle/Controller/TagControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/TagControllerTest.php | |||
@@ -46,7 +46,7 @@ class TagControllerTest extends WallabagCoreTestCase | |||
46 | ->getRepository('WallabagCoreBundle:Entry') | 46 | ->getRepository('WallabagCoreBundle:Entry') |
47 | ->findByUrlAndUserId('http://0.0.0.0/entry1', $this->getLoggedInUserId()); | 47 | ->findByUrlAndUserId('http://0.0.0.0/entry1', $this->getLoggedInUserId()); |
48 | 48 | ||
49 | $this->assertEquals(3, count($entry->getTags())); | 49 | $this->assertEquals(4, count($entry->getTags())); |
50 | 50 | ||
51 | // tag already exists and already assigned | 51 | // tag already exists and already assigned |
52 | $client->submit($form, $data); | 52 | $client->submit($form, $data); |
@@ -57,7 +57,7 @@ class TagControllerTest extends WallabagCoreTestCase | |||
57 | ->getRepository('WallabagCoreBundle:Entry') | 57 | ->getRepository('WallabagCoreBundle:Entry') |
58 | ->find($entry->getId()); | 58 | ->find($entry->getId()); |
59 | 59 | ||
60 | $this->assertEquals(3, count($newEntry->getTags())); | 60 | $this->assertEquals(4, count($newEntry->getTags())); |
61 | 61 | ||
62 | // tag already exists but still not assigned to this entry | 62 | // tag already exists but still not assigned to this entry |
63 | $data = [ | 63 | $data = [ |
@@ -72,7 +72,7 @@ class TagControllerTest extends WallabagCoreTestCase | |||
72 | ->getRepository('WallabagCoreBundle:Entry') | 72 | ->getRepository('WallabagCoreBundle:Entry') |
73 | ->find($entry->getId()); | 73 | ->find($entry->getId()); |
74 | 74 | ||
75 | $this->assertEquals(3, count($newEntry->getTags())); | 75 | $this->assertEquals(4, count($newEntry->getTags())); |
76 | } | 76 | } |
77 | 77 | ||
78 | public function testAddMultipleTagToEntry() | 78 | public function testAddMultipleTagToEntry() |