]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Added notmatches operator for tagging rule
authorNicolas Lœuillet <nicolas@loeuillet.org>
Thu, 20 Apr 2017 12:58:20 +0000 (14:58 +0200)
committerNicolas Lœuillet <nicolas@loeuillet.org>
Thu, 20 Apr 2017 13:17:02 +0000 (15:17 +0200)
32 files changed:
docs/de/user/configuration.rst
docs/en/user/configuration.rst
docs/fr/user/configuration.rst
src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTaggingRuleData.php
src/Wallabag/CoreBundle/Entity/TaggingRule.php
src/Wallabag/CoreBundle/Operator/Doctrine/NotMatches.php [new file with mode: 0644]
src/Wallabag/CoreBundle/Operator/PHP/NotMatches.php [new file with mode: 0644]
src/Wallabag/CoreBundle/Resources/config/services.yml
src/Wallabag/CoreBundle/Resources/translations/messages.da.yml
src/Wallabag/CoreBundle/Resources/translations/messages.de.yml
src/Wallabag/CoreBundle/Resources/translations/messages.en.yml
src/Wallabag/CoreBundle/Resources/translations/messages.es.yml
src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml
src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
src/Wallabag/CoreBundle/Resources/translations/messages.it.yml
src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml
src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml
src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml
src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml
src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml
src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig
tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php
tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php
tests/Wallabag/CoreBundle/Controller/ExportControllerTest.php
tests/Wallabag/CoreBundle/Controller/TagControllerTest.php
tests/Wallabag/ImportBundle/Controller/ChromeControllerTest.php
tests/Wallabag/ImportBundle/Controller/FirefoxControllerTest.php
tests/Wallabag/ImportBundle/Controller/InstapaperControllerTest.php
tests/Wallabag/ImportBundle/Controller/PinboardControllerTest.php
tests/Wallabag/ImportBundle/Controller/ReadabilityControllerTest.php
tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php
tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php

index c0c04bde176dc25f387cf92262d028e29087ecbc..06cae7cbe30113f53f6a51d5aa24698a1ec3bb5e 100644 (file)
@@ -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  
+===========  ==============================================  ==========  ==========
index bba12cb9c555bec852170ffed1b85d417a12b431..0f3ac38f27839f34ad01c41ffae8cdb139b1dd8a 100644 (file)
@@ -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"
+===========  ==============================================  ==========  ==========
index 772000c3444c63819150e5b65bbc9375b5aec208..0f5d4375c2e5259b049ddafeadb5469c889e104f 100644 (file)
@@ -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"
 ===========  ==============================================  ==========  ==========
index 7efe6356e836385306240d900ff5e1f89d280e51..55abd63cda9a3d26562521eef55470ecd51f3376 100644 (file)
@@ -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();
     }
 
index 72651b19e1af2e17542c6199876b825f080d0267..84e11e261f3657d2e6f5225b0bd5a15358bc33b9 100644 (file)
@@ -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<string> $tags
+     * @param array <string> $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 (file)
index 0000000..090da77
--- /dev/null
@@ -0,0 +1,25 @@
+<?php
+
+namespace Wallabag\CoreBundle\Operator\Doctrine;
+
+/**
+ * Provides a "notmatches" operator used for tagging rules.
+ *
+ * It asserts that a given pattern is not contained in a subject, in a
+ * case-insensitive way.
+ *
+ * This operator will be used to compile tagging rules in DQL, usable
+ * by Doctrine ORM.
+ * It's registered in RulerZ using a service (wallabag.operator.doctrine.matches);
+ */
+class NotMatches
+{
+    public function __invoke($subject, $pattern)
+    {
+        if ($pattern[0] === "'") {
+            $pattern = sprintf("'%%%s%%'", substr($pattern, 1, -1));
+        }
+
+        return sprintf('UPPER(%s) NOT LIKE UPPER(%s)', $subject, $pattern);
+    }
+}
diff --git a/src/Wallabag/CoreBundle/Operator/PHP/NotMatches.php b/src/Wallabag/CoreBundle/Operator/PHP/NotMatches.php
new file mode 100644 (file)
index 0000000..eecb43c
--- /dev/null
@@ -0,0 +1,21 @@
+<?php
+
+namespace Wallabag\CoreBundle\Operator\PHP;
+
+/**
+ * Provides a "notmatches" operator used for tagging rules.
+ *
+ * It asserts that a given pattern is not contained in a subject, in a
+ * case-insensitive way.
+ *
+ * This operator will be used to compile tagging rules in PHP, usable
+ * directly on Entry objects for instance.
+ * It's registered in RulerZ using a service (wallabag.operator.array.matches);
+ */
+class NotMatches
+{
+    public function __invoke($subject, $pattern)
+    {
+        return stripos($subject, $pattern) === false;
+    }
+}
index 51d6ab47b21af00df7098b1a572912fc13787c37..bccb2e19ac122172f0ca8e4167c850dac6772c3e 100644 (file)
@@ -125,6 +125,16 @@ services:
         tags:
             - { name: rulerz.operator, target: doctrine, operator: matches, inline: true }
 
+    wallabag.operator.array.notmatches:
+        class: Wallabag\CoreBundle\Operator\PHP\NotMatches
+        tags:
+            - { name: rulerz.operator, target: native, operator: notmatches }
+
+    wallabag.operator.doctrine.notmatches:
+        class: Wallabag\CoreBundle\Operator\Doctrine\NotMatches
+        tags:
+            - { name: rulerz.operator, target: doctrine, operator: notmatches, inline: true }
+
     wallabag_core.helper.redirect:
         class: Wallabag\CoreBundle\Helper\Redirect
         arguments:
index 72493fe39d41f09c762d5dc29f9b1b84a3ecdcb4..e5211b5730c69c6bbe84a6b617b25a7482013e40 100644 (file)
@@ -155,7 +155,7 @@ config:
         #         or: 'One rule OR another'
         #         and: 'One rule AND another'
         #         matches: 'Tests that a <i>subject</i> is matches a <i>search</i> (case-insensitive).<br />Example: <code>title matches "football"</code>'
-
+        #         notmatches: 'Tests that a <i>subject</i> is not matches a <i>search</i> (case-insensitive).<br />Example: <code>title notmatches "football"</code>'
 entry:
     page_titles:
         # unread: 'Unread entries'
index dbad8b16fabbf5edf596940aecc449fbdb70afce..893a45648bfbd515d159c32534e452a4ad6fbe6b 100644 (file)
@@ -155,6 +155,7 @@ config:
                 or: 'Eine Regel ODER die andere'
                 and: 'Eine Regel UND eine andere'
                 matches: 'Testet, ob eine <i>Variable</i> auf eine <i>Suche</i> zutrifft (Groß- und Kleinschreibung wird nicht berücksichtigt).<br />Beispiel: <code>title matches "Fußball"</code>'
+                # notmatches: 'Tests that a <i>subject</i> is not matches a <i>search</i> (case-insensitive).<br />Example: <code>title notmatches "football"</code>'
 
 entry:
     page_titles:
index 7da9fe6b7cec186f73de9530596712f98ecd3544..29f9938cf424b44b2c370ada19a7d403ba3e817c 100644 (file)
@@ -155,6 +155,7 @@ config:
                 or: 'One rule OR another'
                 and: 'One rule AND another'
                 matches: 'Tests that a <i>subject</i> is matches a <i>search</i> (case-insensitive).<br />Example: <code>title matches "football"</code>'
+                notmatches: 'Tests that a <i>subject</i> is not matches a <i>search</i> (case-insensitive).<br />Example: <code>title notmatches "football"</code>'
 
 entry:
     page_titles:
index 6e21614e25cd7623f31f5fc54d6dfb2c5e4625fc..99d2585924902f3f9012bf9fb6869ab04cf802cf 100644 (file)
@@ -155,6 +155,7 @@ config:
                 or: 'Una regla U otra'
                 and: 'Una regla Y la otra'
                 matches: 'Prueba si un <i>sujeto</i> corresponde a una <i>búsqueda</i> (insensible a mayusculas).<br />Ejemplo : <code>title matches "fútbol"</code>'
+                # notmatches: 'Tests that a <i>subject</i> is not matches a <i>search</i> (case-insensitive).<br />Example: <code>title notmatches "football"</code>'
 
 entry:
     page_titles:
index b938c80aa7ad713f4963205d6e17ec04e83996ef..ccd9d5557c715bd97664d5932cc11918a71beb7b 100644 (file)
@@ -155,6 +155,7 @@ config:
         #         or: 'One rule OR another'
         #         and: 'One rule AND another'
         #         matches: 'Tests that a <i>subject</i> is matches a <i>search</i> (case-insensitive).<br />Example: <code>title matches "football"</code>'
+        #         notmatches: 'Tests that a <i>subject</i> is not matches a <i>search</i> (case-insensitive).<br />Example: <code>title notmatches "football"</code>'
 
 entry:
     page_titles:
index 9abcda45cf9ba1ceab87c99a4eb567e85a1714aa..a0f100f7a138f9ddd9b259b01b45c54c64058841 100644 (file)
@@ -155,6 +155,7 @@ config:
                 or: "Une règle OU l’autre"
                 and: "Une règle ET l’autre"
                 matches: "Teste si un <i>sujet</i> correspond à une <i>recherche</i> (non sensible à la casse).<br />Exemple : <code>title matches \"football\"</code>"
+                notmatches: "Teste si un <i>sujet</i> ne correspond pas à une <i>recherche</i> (non sensible à la casse).<br />Exemple : <code>title notmatches \"football\"</code>"
 
 entry:
     page_titles:
index 58d0962a0bc326cc2c6fb2de08aeb1cd0786b362..374071ce0df95c8bf0a5a695699e7edc39e88cac 100644 (file)
@@ -155,6 +155,7 @@ config:
                 or: "Una regola O un'altra"
                 and: "Una regola E un'altra"
                 matches: 'Verifica che un <i>oggetto</i> risulti in una <i>ricerca</i> (case-insensitive).<br />Esempio: <code>titolo contiene "football"</code>'
+                # notmatches: 'Tests that a <i>subject</i> is not matches a <i>search</i> (case-insensitive).<br />Example: <code>title notmatches "football"</code>'
 
 entry:
     page_titles:
index 825a0efd14e862b57629c47823fc1ded816237f2..b01c611bc1f5183327cc90f6cfac943f21b04c29 100644 (file)
@@ -155,6 +155,7 @@ config:
                 or: "Una règla O l'autra"
                 and: "Una règla E l'autra"
                 matches: 'Teste se un <i>subjècte</i> correspond a una <i>recerca</i> (non sensibla a la cassa).<br />Exemple : <code>title matches \"football\"</code>'
+                # notmatches: 'Tests that a <i>subject</i> is not matches a <i>search</i> (case-insensitive).<br />Example: <code>title notmatches "football"</code>'
 
 entry:
     page_titles:
index b02aa4ec491bea5a211b790890795392893a111b..d76ac32818e5db110fa0d6ed440549d402d00363 100644 (file)
@@ -155,6 +155,7 @@ config:
                 or: 'Jedna reguła LUB inna'
                 and: 'Jedna reguła I inna'
                 matches: 'Sprawdź czy <i>temat</i> pasuje <i>szukaj</i> (duże lub małe litery).<br />Przykład: <code>tytuł zawiera "piłka nożna"</code>'
+                # notmatches: 'Tests that a <i>subject</i> is not matches a <i>search</i> (case-insensitive).<br />Example: <code>title notmatches "football"</code>'
 
 entry:
     page_titles:
index 8aa7e5af87a0657e1bc92f0e15b95bc31fe2c03e..98dfcd25788354a31c0b6c2b836ddc3ab2f2146e 100644 (file)
@@ -155,6 +155,7 @@ config:
                 or: 'Uma regra OU outra'
                 and: 'Uma regra E outra'
                 matches: 'Testa que um <i>assunto</i> corresponde a uma <i>pesquisa</i> (maiúscula ou minúscula).<br />Exemplo: <code>título corresponde a "futebol"</code>'
+                # notmatches: 'Tests that a <i>subject</i> is not matches a <i>search</i> (case-insensitive).<br />Example: <code>title notmatches "football"</code>'
 
 entry:
     page_titles:
index ce8d8d52109c1e895de68f44461c7e179e0316ae..8c07c13f3ab059b19e5bec3436e41b561bbdaf80 100644 (file)
@@ -155,6 +155,7 @@ config:
         #         or: 'One rule OR another'
         #         and: 'One rule AND another'
         #         matches: 'Tests that a <i>subject</i> is matches a <i>search</i> (case-insensitive).<br />Example: <code>title matches "football"</code>'
+        #         notmatches: 'Tests that a <i>subject</i> is not matches a <i>search</i> (case-insensitive).<br />Example: <code>title notmatches "football"</code>'
 
 entry:
     page_titles:
index d890360862119681ca26058b1c78f9eba0641ee3..bd21cb6743a1af6cc845f16d7f88bee438de3827 100644 (file)
@@ -155,6 +155,7 @@ config:
                 or: 'Bir kural veya birbaşkası'
                 and: 'Bir kural ve diğeri'
                 # matches: 'Tests that a <i>subject</i> is matches a <i>search</i> (case-insensitive).<br />Example: <code>title matches "football"</code>'
+                # notmatches: 'Tests that a <i>subject</i> is not matches a <i>search</i> (case-insensitive).<br />Example: <code>title notmatches "football"</code>'
 
 entry:
     page_titles:
index 708ff951f609e3091207c527a5336e706d89309d..d6e414e902d02ca6783905fa643fbf8c6fe3c21d 100644 (file)
                                         <tr>
                                             <td>domainName</td>
                                             <td>{{ 'config.form_rules.faq.variable_description.domainName'|trans }}</td>
-                                            <td>matches</td>
-                                            <td>{{ 'config.form_rules.faq.operator_description.matches'|trans|raw }}</td>
+                                            <td>matches<br />notmaches</td>
+                                            <td>{{ 'config.form_rules.faq.operator_description.matches'|trans|raw }}<br />{{ 'config.form_rules.faq.operator_description.notmatches'|trans|raw }}</td>
                                         </tr>
                                     </tbody>
                                 </table>
index dc5160c7a0badebea65f41f951db0ce7f8326b6d..d9acacfce479c9177c6fa89656819b9e62213de1 100644 (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()
index d26a56f8a9fac6384872482c4bb15b274b3b3545..35438c839c6dd7847a42c24af0c510f75ef0cfef 100644 (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();
index 32a18e261a702fdaa80b27a00aa4af1b504915f7..1b8ecc49748e75a780056483d330b983bb5c7f6f 100644 (file)
@@ -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()
index fa1a3539f4960d5d4b23d00222d404058f2ed12a..c3b22dcd2c41fb2aa148ed09ca6e43ffe77bd804 100644 (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()
index c1f82ea95702ffa4a928ca1d73c0d06cb0847d29..8e9f65e31db559c91f23228192432b890f4019f3 100644 (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'));
index 7557ea328b7819f426d102aa379ff2b7761df384..684530277085bd2b3d880a7bf00a3146da18471e 100644 (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')
index 3f6f2b9f93b3dedc4151c3b9314c961c1e7cb382..c2e5fdb752f8f8461150ca917e00f67b7ebceb86 100644 (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());
     }
 
index 75a7e332f3206596e06292738b2ba656196c7080..96b32484299ebc0453f8b60b1f0a8c31c632bae9 100644 (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'));
     }
index acb61ca1837f14c5c9a682b5ad18b75ebf17e640..e6d33fe99933f4e6735e658edda17c9ff5bf885f 100644 (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'));
     }
index acc3999797a7875a7268b83c52a26b756ad68d50..0c7f97ed6a87ec67dfa422ca54f8e6e456529202 100644 (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());
     }
 
index 26e2f40bd219fc0ce66520879e75690352fa2a74..556ab1bdcfa3490802f10b900ad65139e10cdfc6 100644 (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'));
     }