From: Nicolas Lœuillet Date: Thu, 20 Apr 2017 12:58:20 +0000 (+0200) Subject: Added notmatches operator for tagging rule X-Git-Tag: 2.3.0~31^2~111^2~2 X-Git-Url: https://git.immae.eu/?p=github%2Fwallabag%2Fwallabag.git;a=commitdiff_plain;h=fdd725f58cfe96d9bb9454d0347f6ff847fce69d Added notmatches operator for tagging rule --- diff --git a/docs/de/user/configuration.rst b/docs/de/user/configuration.rst index c0c04bde..06cae7cb 100644 --- a/docs/de/user/configuration.rst +++ b/docs/de/user/configuration.rst @@ -115,16 +115,17 @@ Welche Variablen und Operatoren kann ich zum Regeln schreiben nutzen? Die folgenden Variablen und Operatoren können genutzt werden, um Tagging-Regeln zu erstellen (sei vorsichtig, denn bei einigen Werten musst du Anführungszeichen hinzufügen, z.B. ``language = "de"``): -=========== ============================================== ======== ========== -Variable Bedeutung Operator Bedeutung ------------ ---------------------------------------------- -------- ---------- -title Titel des Artikels <= Kleiner gleich als… -url URL des Artikels < Kleiner als… -isArchived Ob der Artikel archiviert ist oder nicht => Größer gleich als… -isStarred Ob der Artikel favorisiert ist oder nicht > Größer als… -content Inhalt des Eintrags = Gleich zu… -language Sprache des Eintrags != Nicht gleich zu… -mimetype MIME-Typ des Eintrags OR Eine Regel oder die andere -readingTime Die geschätzte Lesezeit in Minuten AND Eine Regel und die andere -domainName Der Domain-Name des Eintrags matches Testet, dass ein Feld einer Suche (unabhängig von Groß- und Kleinschreibung) übereinstimmt. Z.B.: title matches "Fußball" -=========== ============================================== ======== ========== +=========== ============================================== ========== ========== +Variable Bedeutung Operator Bedeutung +----------- ---------------------------------------------- ---------- ---------- +title Titel des Artikels <= Kleiner gleich als… +url URL des Artikels < Kleiner als… +isArchived Ob der Artikel archiviert ist oder nicht => Größer gleich als… +isStarred Ob der Artikel favorisiert ist oder nicht > Größer als… +content Inhalt des Eintrags = Gleich zu… +language Sprache des Eintrags != Nicht gleich zu… +mimetype MIME-Typ des Eintrags OR Eine Regel oder die andere +readingTime Die geschätzte Lesezeit in Minuten AND Eine Regel und die andere +domainName Der Domain-Name des Eintrags matches Testet, dass ein Feld einer Suche (unabhängig von Groß- und Kleinschreibung) übereinstimmt. Z.B.: title matches "Fußball" + notmatches +=========== ============================================== ========== ========== diff --git a/docs/en/user/configuration.rst b/docs/en/user/configuration.rst index bba12cb9..0f3ac38f 100644 --- a/docs/en/user/configuration.rst +++ b/docs/en/user/configuration.rst @@ -116,16 +116,17 @@ Which variables and operators can I use to write rules? The following variables and operators can be used to create tagging rules (be careful, for some values, you need to add quotes, for example ``language = "en"``): -=========== ============================================== ======== ========== -Variable Meaning Operator Meaning ------------ ---------------------------------------------- -------- ---------- -title Title of the entry <= Less than… -url URL of the entry < Strictly less than… -isArchived Whether the entry is archived or not => Greater than… -isStarred Whether the entry is starred or not > Strictly greater than… -content The entry's content = Equal to… -language The entry's language != Not equal to… -mimetype The entry's mime-type OR One rule or another -readingTime The estimated entry's reading time, in minutes AND One rule and another -domainName The domain name of the entry matches Tests that a subject is matches a search (case-insensitive). Example: title matches "football" -=========== ============================================== ======== ========== +=========== ============================================== ========== ========== +Variable Meaning Operator Meaning +----------- ---------------------------------------------- ---------- ---------- +title Title of the entry <= Less than… +url URL of the entry < Strictly less than… +isArchived Whether the entry is archived or not => Greater than… +isStarred Whether the entry is starred or not > Strictly greater than… +content The entry's content = Equal to… +language The entry's language != Not equal to… +mimetype The entry's mime-type OR One rule or another +readingTime The estimated entry's reading time, in minutes AND One rule and another +domainName The domain name of the entry matches Tests that a subject is matches a search (case-insensitive). Example: title matches "football" + notmatches Tests that a subject is not matches a search (case-insensitive). Example: title notmatches "football" +=========== ============================================== ========== ========== diff --git a/docs/fr/user/configuration.rst b/docs/fr/user/configuration.rst index 772000c3..0f5d4375 100644 --- a/docs/fr/user/configuration.rst +++ b/docs/fr/user/configuration.rst @@ -130,4 +130,5 @@ language La langue de l'article != Différ mimetype The type MIME de l'article OR Telle règle ou telle autre règle readingTime Le temps de lecture de l'article, en minutes AND Telle règle et telle règle domainName Le nom de domaine de l'article matches Contient telle chaîne de caractère (insensible à la casse). Exemple : title matches "football" + notmaches Ne contient pas telle chaîne de caractère (insensible à la casse). Exemple : title notmatches "football" =========== ============================================== ========== ========== diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTaggingRuleData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTaggingRuleData.php index 7efe6356..55abd63c 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTaggingRuleData.php +++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTaggingRuleData.php @@ -36,6 +36,13 @@ class LoadTaggingRuleData extends AbstractFixture implements OrderedFixtureInter $manager->persist($tr3); + $tr4 = new TaggingRule(); + $tr4->setRule('content notmatches "basket"'); + $tr4->setTags(['foot']); + $tr4->setConfig($this->getReference('admin-config')); + + $manager->persist($tr4); + $manager->flush(); } diff --git a/src/Wallabag/CoreBundle/Entity/TaggingRule.php b/src/Wallabag/CoreBundle/Entity/TaggingRule.php index 72651b19..84e11e26 100644 --- a/src/Wallabag/CoreBundle/Entity/TaggingRule.php +++ b/src/Wallabag/CoreBundle/Entity/TaggingRule.php @@ -31,7 +31,7 @@ class TaggingRule * @Assert\Length(max=255) * @RulerZAssert\ValidRule( * allowed_variables={"title", "url", "isArchived", "isStared", "content", "language", "mimetype", "readingTime", "domainName"}, - * allowed_operators={">", "<", ">=", "<=", "=", "is", "!=", "and", "not", "or", "matches"} + * allowed_operators={">", "<", ">=", "<=", "=", "is", "!=", "and", "not", "or", "matches", "notmatches"} * ) * @ORM\Column(name="rule", type="string", nullable=false) */ @@ -87,7 +87,7 @@ class TaggingRule /** * Set tags. * - * @param array $tags + * @param array $tags * * @return TaggingRule */ diff --git a/src/Wallabag/CoreBundle/Operator/Doctrine/NotMatches.php b/src/Wallabag/CoreBundle/Operator/Doctrine/NotMatches.php new file mode 100644 index 00000000..090da77c --- /dev/null +++ b/src/Wallabag/CoreBundle/Operator/Doctrine/NotMatches.php @@ -0,0 +1,25 @@ +subject is matches a search (case-insensitive).
Example: title matches "football"' - + # notmatches: 'Tests that a subject is not matches a search (case-insensitive).
Example: title notmatches "football"' entry: page_titles: # unread: 'Unread entries' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml index dbad8b16..893a4564 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml @@ -155,6 +155,7 @@ config: or: 'Eine Regel ODER die andere' and: 'Eine Regel UND eine andere' matches: 'Testet, ob eine Variable auf eine Suche zutrifft (Groß- und Kleinschreibung wird nicht berücksichtigt).
Beispiel: title matches "Fußball"' + # notmatches: 'Tests that a subject is not matches a search (case-insensitive).
Example: title notmatches "football"' entry: page_titles: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml index 7da9fe6b..29f9938c 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml @@ -155,6 +155,7 @@ config: or: 'One rule OR another' and: 'One rule AND another' matches: 'Tests that a subject is matches a search (case-insensitive).
Example: title matches "football"' + notmatches: 'Tests that a subject is not matches a search (case-insensitive).
Example: title notmatches "football"' entry: page_titles: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml index 6e21614e..99d25859 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml @@ -155,6 +155,7 @@ config: or: 'Una regla U otra' and: 'Una regla Y la otra' matches: 'Prueba si un sujeto corresponde a una búsqueda (insensible a mayusculas).
Ejemplo : title matches "fútbol"' + # notmatches: 'Tests that a subject is not matches a search (case-insensitive).
Example: title notmatches "football"' entry: page_titles: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml index b938c80a..ccd9d555 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml @@ -155,6 +155,7 @@ config: # or: 'One rule OR another' # and: 'One rule AND another' # matches: 'Tests that a subject is matches a search (case-insensitive).
Example: title matches "football"' + # notmatches: 'Tests that a subject is not matches a search (case-insensitive).
Example: title notmatches "football"' entry: page_titles: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml index 9abcda45..a0f100f7 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml @@ -155,6 +155,7 @@ config: or: "Une règle OU l’autre" and: "Une règle ET l’autre" matches: "Teste si un sujet correspond à une recherche (non sensible à la casse).
Exemple : title matches \"football\"" + notmatches: "Teste si un sujet ne correspond pas à une recherche (non sensible à la casse).
Exemple : title notmatches \"football\"" entry: page_titles: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml index 58d0962a..374071ce 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml @@ -155,6 +155,7 @@ config: or: "Una regola O un'altra" and: "Una regola E un'altra" matches: 'Verifica che un oggetto risulti in una ricerca (case-insensitive).
Esempio: titolo contiene "football"' + # notmatches: 'Tests that a subject is not matches a search (case-insensitive).
Example: title notmatches "football"' entry: page_titles: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml index 825a0efd..b01c611b 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml @@ -155,6 +155,7 @@ config: or: "Una règla O l'autra" and: "Una règla E l'autra" matches: 'Teste se un subjècte correspond a una recerca (non sensibla a la cassa).
Exemple : title matches \"football\"' + # notmatches: 'Tests that a subject is not matches a search (case-insensitive).
Example: title notmatches "football"' entry: page_titles: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml index b02aa4ec..d76ac328 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml @@ -155,6 +155,7 @@ config: or: 'Jedna reguła LUB inna' and: 'Jedna reguła I inna' matches: 'Sprawdź czy temat pasuje szukaj (duże lub małe litery).
Przykład: tytuł zawiera "piłka nożna"' + # notmatches: 'Tests that a subject is not matches a search (case-insensitive).
Example: title notmatches "football"' entry: page_titles: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml index 8aa7e5af..98dfcd25 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml @@ -155,6 +155,7 @@ config: or: 'Uma regra OU outra' and: 'Uma regra E outra' matches: 'Testa que um assunto corresponde a uma pesquisa (maiúscula ou minúscula).
Exemplo: título corresponde a "futebol"' + # notmatches: 'Tests that a subject is not matches a search (case-insensitive).
Example: title notmatches "football"' entry: page_titles: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml index ce8d8d52..8c07c13f 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml @@ -155,6 +155,7 @@ config: # or: 'One rule OR another' # and: 'One rule AND another' # matches: 'Tests that a subject is matches a search (case-insensitive).
Example: title matches "football"' + # notmatches: 'Tests that a subject is not matches a search (case-insensitive).
Example: title notmatches "football"' entry: page_titles: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml index d8903608..bd21cb67 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml @@ -155,6 +155,7 @@ config: or: 'Bir kural veya birbaşkası' and: 'Bir kural ve diğeri' # matches: 'Tests that a subject is matches a search (case-insensitive).
Example: title matches "football"' + # notmatches: 'Tests that a subject is not matches a search (case-insensitive).
Example: title notmatches "football"' entry: page_titles: diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig index 708ff951..d6e414e9 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig @@ -413,8 +413,8 @@ domainName {{ 'config.form_rules.faq.variable_description.domainName'|trans }} - matches - {{ 'config.form_rules.faq.operator_description.matches'|trans|raw }} + matches
notmaches + {{ 'config.form_rules.faq.operator_description.matches'|trans|raw }}
{{ 'config.form_rules.faq.operator_description.notmatches'|trans|raw }} diff --git a/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php b/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php index dc5160c7..d9acacfc 100644 --- a/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php +++ b/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php @@ -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() 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 ->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(); diff --git a/tests/Wallabag/CoreBundle/Controller/ExportControllerTest.php b/tests/Wallabag/CoreBundle/Controller/ExportControllerTest.php index 32a18e26..1b8ecc49 100644 --- a/tests/Wallabag/CoreBundle/Controller/ExportControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/ExportControllerTest.php @@ -241,7 +241,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() 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 ->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() diff --git a/tests/Wallabag/ImportBundle/Controller/ChromeControllerTest.php b/tests/Wallabag/ImportBundle/Controller/ChromeControllerTest.php index c1f82ea9..8e9f65e3 100644 --- a/tests/Wallabag/ImportBundle/Controller/ChromeControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/ChromeControllerTest.php @@ -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')); diff --git a/tests/Wallabag/ImportBundle/Controller/FirefoxControllerTest.php b/tests/Wallabag/ImportBundle/Controller/FirefoxControllerTest.php index 7557ea32..68453027 100644 --- a/tests/Wallabag/ImportBundle/Controller/FirefoxControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/FirefoxControllerTest.php @@ -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') diff --git a/tests/Wallabag/ImportBundle/Controller/InstapaperControllerTest.php b/tests/Wallabag/ImportBundle/Controller/InstapaperControllerTest.php index 3f6f2b9f..c2e5fdb7 100644 --- a/tests/Wallabag/ImportBundle/Controller/InstapaperControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/InstapaperControllerTest.php @@ -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()); } diff --git a/tests/Wallabag/ImportBundle/Controller/PinboardControllerTest.php b/tests/Wallabag/ImportBundle/Controller/PinboardControllerTest.php index 75a7e332..96b32484 100644 --- a/tests/Wallabag/ImportBundle/Controller/PinboardControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/PinboardControllerTest.php @@ -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')); } diff --git a/tests/Wallabag/ImportBundle/Controller/ReadabilityControllerTest.php b/tests/Wallabag/ImportBundle/Controller/ReadabilityControllerTest.php index acb61ca1..e6d33fe9 100644 --- a/tests/Wallabag/ImportBundle/Controller/ReadabilityControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/ReadabilityControllerTest.php @@ -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')); } diff --git a/tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php b/tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php index acc39997..0c7f97ed 100644 --- a/tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php @@ -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()); } diff --git a/tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php b/tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php index 26e2f40b..556ab1bd 100644 --- a/tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php @@ -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')); }