From fdd725f58cfe96d9bb9454d0347f6ff847fce69d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Thu, 20 Apr 2017 14:58:20 +0200 Subject: [PATCH] Added notmatches operator for tagging rule --- docs/de/user/configuration.rst | 27 ++++++++++--------- docs/en/user/configuration.rst | 27 ++++++++++--------- docs/fr/user/configuration.rst | 1 + .../DataFixtures/ORM/LoadTaggingRuleData.php | 7 +++++ .../CoreBundle/Entity/TaggingRule.php | 4 +-- .../Operator/Doctrine/NotMatches.php | 25 +++++++++++++++++ .../CoreBundle/Operator/PHP/NotMatches.php | 21 +++++++++++++++ .../CoreBundle/Resources/config/services.yml | 10 +++++++ .../Resources/translations/messages.da.yml | 2 +- .../Resources/translations/messages.de.yml | 1 + .../Resources/translations/messages.en.yml | 1 + .../Resources/translations/messages.es.yml | 1 + .../Resources/translations/messages.fa.yml | 1 + .../Resources/translations/messages.fr.yml | 1 + .../Resources/translations/messages.it.yml | 1 + .../Resources/translations/messages.oc.yml | 1 + .../Resources/translations/messages.pl.yml | 1 + .../Resources/translations/messages.pt.yml | 1 + .../Resources/translations/messages.ro.yml | 1 + .../Resources/translations/messages.tr.yml | 1 + .../themes/material/Config/index.html.twig | 4 +-- .../Controller/EntryRestControllerTest.php | 4 +-- .../Controller/EntryControllerTest.php | 6 ++--- .../Controller/ExportControllerTest.php | 2 +- .../Controller/TagControllerTest.php | 6 ++--- .../Controller/ChromeControllerTest.php | 2 +- .../Controller/FirefoxControllerTest.php | 2 +- .../Controller/InstapaperControllerTest.php | 2 +- .../Controller/PinboardControllerTest.php | 2 +- .../Controller/ReadabilityControllerTest.php | 2 +- .../Controller/WallabagV1ControllerTest.php | 2 +- .../Controller/WallabagV2ControllerTest.php | 4 +-- 32 files changed, 125 insertions(+), 48 deletions(-) create mode 100644 src/Wallabag/CoreBundle/Operator/Doctrine/NotMatches.php create mode 100644 src/Wallabag/CoreBundle/Operator/PHP/NotMatches.php diff --git a/docs/de/user/configuration.rst b/docs/de/user/configuration.rst index c0c04bde1..06cae7cbe 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 bba12cb9c..0f3ac38f2 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 772000c34..0f5d4375c 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 7efe6356e..55abd63cd 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 72651b19e..84e11e261 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 000000000..090da77cd --- /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 dbad8b16f..893a45648 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 7da9fe6b7..29f9938cf 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 6e21614e2..99d258592 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 b938c80aa..ccd9d5557 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 9abcda45c..a0f100f7a 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 58d0962a0..374071ce0 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 825a0efd1..b01c611bc 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 b02aa4ec4..d76ac3281 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 8aa7e5af8..98dfcd257 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 ce8d8d521..8c07c13f3 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 d89036086..bd21cb674 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 708ff951f..d6e414e90 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 dc5160c7a..d9acacfce 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 d26a56f8a..35438c839 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 32a18e261..1b8ecc497 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 fa1a3539f..c3b22dcd2 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 c1f82ea95..8e9f65e31 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 7557ea328..684530277 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 3f6f2b9f9..c2e5fdb75 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 75a7e332f..96b324842 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 acb61ca18..e6d33fe99 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 acc399979..0c7f97ed6 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 26e2f40bd..556ab1bdc 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')); }