1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-08-01 17:38:38 +00:00

Merge pull request #3047 from wallabag/add-notmatches-operator

Added notmatches operator for tagging rule
This commit is contained in:
Nicolas Lœuillet 2017-05-03 11:53:01 +02:00 committed by GitHub
commit 9c09c253fe
32 changed files with 126 additions and 51 deletions

View file

@ -337,7 +337,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
$this->assertEquals(false, $content['is_starred']);
$this->assertEquals('New title for my article', $content['title']);
$this->assertEquals(1, $content['user_id']);
$this->assertCount(1, $content['tags']);
$this->assertCount(2, $content['tags']);
}
public function testPostSameEntry()
@ -356,7 +356,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
$this->assertEquals('http://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html', $content['url']);
$this->assertEquals(true, $content['is_archived']);
$this->assertEquals(false, $content['is_starred']);
$this->assertCount(2, $content['tags']);
$this->assertCount(3, $content['tags']);
}
public function testPostArchivedAndStarredEntry()

View file

@ -270,7 +270,7 @@ class EntryControllerTest extends WallabagCoreTestCase
->findOneByUrl($url);
$tags = $entry->getTags();
$this->assertCount(1, $tags);
$this->assertCount(2, $tags);
$this->assertEquals('wallabag', $tags[0]->getLabel());
$em->remove($entry);
@ -299,8 +299,8 @@ class EntryControllerTest extends WallabagCoreTestCase
$tags = $entry->getTags();
$this->assertCount(1, $tags);
$this->assertEquals('wallabag', $tags[0]->getLabel());
$this->assertCount(2, $tags);
$this->assertEquals('wallabag', $tags[1]->getLabel());
$em->remove($entry);
$em->flush();

View file

@ -189,11 +189,9 @@ class ExportControllerTest extends WallabagCoreTestCase
$this->assertContains($contentInDB[0]['language'], $csv[1]);
$this->assertContains($contentInDB[0]['createdAt']->format('d/m/Y h:i:s'), $csv[1]);
$expectedTag = [];
foreach ($contentInDB[0]['tags'] as $tag) {
$expectedTag[] = $tag['label'];
$this->assertContains($tag['label'], $csv[1]);
}
$this->assertContains(implode(', ', $expectedTag), $csv[1]);
}
public function testJsonExport()
@ -241,7 +239,7 @@ class ExportControllerTest extends WallabagCoreTestCase
$this->assertEquals($contentInDB->getLanguage(), $content[0]['language']);
$this->assertEquals($contentInDB->getReadingtime(), $content[0]['reading_time']);
$this->assertEquals($contentInDB->getDomainname(), $content[0]['domain_name']);
$this->assertEquals(['foo bar', 'baz'], $content[0]['tags']);
$this->assertEquals(['foo bar', 'baz', 'foot'], $content[0]['tags']);
}
public function testXmlExport()

View file

@ -46,7 +46,7 @@ class TagControllerTest extends WallabagCoreTestCase
->getRepository('WallabagCoreBundle:Entry')
->findByUrlAndUserId('http://0.0.0.0/entry1', $this->getLoggedInUserId());
$this->assertEquals(3, count($entry->getTags()));
$this->assertEquals(4, count($entry->getTags()));
// tag already exists and already assigned
$client->submit($form, $data);
@ -57,7 +57,7 @@ class TagControllerTest extends WallabagCoreTestCase
->getRepository('WallabagCoreBundle:Entry')
->find($entry->getId());
$this->assertEquals(3, count($newEntry->getTags()));
$this->assertEquals(4, count($newEntry->getTags()));
// tag already exists but still not assigned to this entry
$data = [
@ -72,7 +72,7 @@ class TagControllerTest extends WallabagCoreTestCase
->getRepository('WallabagCoreBundle:Entry')
->find($entry->getId());
$this->assertEquals(3, count($newEntry->getTags()));
$this->assertEquals(4, count($newEntry->getTags()));
}
public function testAddMultipleTagToEntry()

View file

@ -120,7 +120,7 @@ class ChromeControllerTest extends WallabagCoreTestCase
$this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for http://www.usinenouvelle.com is ok');
$this->assertNotEmpty($content->getLanguage(), 'Language for http://www.usinenouvelle.com is ok');
$this->assertEquals(0, count($content->getTags()));
$this->assertEquals(1, count($content->getTags()));
$createdAt = $content->getCreatedAt();
$this->assertEquals('2011', $createdAt->format('Y'));

View file

@ -121,7 +121,7 @@ class FirefoxControllerTest extends WallabagCoreTestCase
$this->assertNotEmpty($content->getMimetype(), 'Mimetype for http://lexpansion.lexpress.fr is ok');
$this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for http://lexpansion.lexpress.fr is ok');
$this->assertNotEmpty($content->getLanguage(), 'Language for http://lexpansion.lexpress.fr is ok');
$this->assertEquals(2, count($content->getTags()));
$this->assertEquals(3, count($content->getTags()));
$content = $client->getContainer()
->get('doctrine.orm.entity_manager')

View file

@ -121,7 +121,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase
$this->assertNotEmpty($content->getMimetype(), 'Mimetype for http://www.liberation.fr is ok');
$this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for http://www.liberation.fr is ok');
$this->assertNotEmpty($content->getLanguage(), 'Language for http://www.liberation.fr is ok');
$this->assertEquals(0, count($content->getTags()));
$this->assertEquals(1, count($content->getTags()));
$this->assertInstanceOf(\DateTime::class, $content->getCreatedAt());
}

View file

@ -121,7 +121,7 @@ class PinboardControllerTest extends WallabagCoreTestCase
$this->assertNotEmpty($content->getMimetype(), 'Mimetype for https://ma.ttias.be is ok');
$this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for https://ma.ttias.be is ok');
$this->assertNotEmpty($content->getLanguage(), 'Language for https://ma.ttias.be is ok');
$this->assertEquals(2, count($content->getTags()));
$this->assertEquals(3, count($content->getTags()));
$this->assertInstanceOf(\DateTime::class, $content->getCreatedAt());
$this->assertEquals('2016-10-26', $content->getCreatedAt()->format('Y-m-d'));
}

View file

@ -121,7 +121,7 @@ class ReadabilityControllerTest extends WallabagCoreTestCase
$this->assertNotEmpty($content->getMimetype(), 'Mimetype for http://www.zataz.com is ok');
$this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for http://www.zataz.com is ok');
$this->assertNotEmpty($content->getLanguage(), 'Language for http://www.zataz.com is ok');
$this->assertEquals(0, count($content->getTags()));
$this->assertEquals(1, count($content->getTags()));
$this->assertInstanceOf(\DateTime::class, $content->getCreatedAt());
$this->assertEquals('2016-09-08', $content->getCreatedAt()->format('Y-m-d'));
}

View file

@ -129,7 +129,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
$this->assertNotEmpty($content->getMimetype(), 'Mimetype for http://www.framablog.org is ok');
$this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for http://www.framablog.org is ok');
$this->assertNotEmpty($content->getLanguage(), 'Language for http://www.framablog.org is ok');
$this->assertEquals(1, count($content->getTags()));
$this->assertEquals(2, count($content->getTags()));
$this->assertInstanceOf(\DateTime::class, $content->getCreatedAt());
}

View file

@ -122,7 +122,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
$this->assertNotEmpty($content->getMimetype(), 'Mimetype for http://www.liberation.fr is ok');
$this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for http://www.liberation.fr is ok');
$this->assertNotEmpty($content->getLanguage(), 'Language for http://www.liberation.fr is ok');
$this->assertEquals(0, count($content->getTags()));
$this->assertEquals(1, count($content->getTags()));
$content = $client->getContainer()
->get('doctrine.orm.entity_manager')
@ -135,7 +135,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
$this->assertNotEmpty($content->getMimetype(), 'Mimetype for https://www.mediapart.fr is ok');
$this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for https://www.mediapart.fr is ok');
$this->assertNotEmpty($content->getLanguage(), 'Language for https://www.mediapart.fr is ok');
$this->assertEquals(2, count($content->getTags()));
$this->assertEquals(3, count($content->getTags()));
$this->assertInstanceOf(\DateTime::class, $content->getCreatedAt());
$this->assertEquals('2016-09-08', $content->getCreatedAt()->format('Y-m-d'));
}