From 9b3c31c1e7108c1ce7478862c289a90646c25786 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Wed, 13 Nov 2024 11:35:03 +0100 Subject: [PATCH] new: Enable the tags system for everyone --- locales/fr_FR/LC_MESSAGES/main.mo | Bin 58278 -> 58169 bytes locales/fr_FR/LC_MESSAGES/main.po | 98 ++++---- src/controllers/Links.php | 47 +--- src/models/dao/Link.php | 1 - src/models/dao/links/SearchQueries.php | 190 -------------- src/views/links/_link.phtml | 2 +- src/views/links/collections/index.phtml | 12 +- src/views/links/show.phtml | 8 +- src/views/messages/edit.phtml | 6 +- tests/models/dao/links/SearchQueriesTest.php | 246 ------------------- 10 files changed, 63 insertions(+), 547 deletions(-) delete mode 100644 src/models/dao/links/SearchQueries.php delete mode 100644 tests/models/dao/links/SearchQueriesTest.php diff --git a/locales/fr_FR/LC_MESSAGES/main.mo b/locales/fr_FR/LC_MESSAGES/main.mo index 509bdd32cd24871080c7bd2c16b820a44b299393..4e43e9cb362a496407340bc486d0c8db3d21941e 100644 GIT binary patch delta 9746 zcmXxp3w+P@9>?+De`Yq@%r<|s8N1)dw#MAHHa3=++bSfiMpULGa;ra1lt}nZ9QOzz zArf^IJJU#1uT!l{iRKkiZ^gLHpsB7_E>>!a2-B`XYg)ppJ`bU z_$=n&0&I*2(buv()@cg#X@L}}FS?Gfcu?a52P~3(MaX)H+pQFZp z9UEZqU6z%G;n*F!Vqbg}v*_QtNa0>8LbENa6Ar<%xC9IES*CRxci|k|(blq_$IeWL zKCHbMgFj#u^O4Q_l6P zPJ9!U0iO<*RSzRjnP};lf&s*B96O_yvKOkK0q9Z6$|$Iz=THsJN0!%Gi1%YPCSycL z%ZkTB)cqq-OELu$@gGPst&OPX&S5@glUBxRjl~7{7HWd|x#ZtXp;si?MD^LxsLUninz40>Y`D+-CUhFvSl}KET$*370LM_p8jK<%Q&1W^sC;#;+#L)UW zOhR>V1QYN$hT(10rVA}FGf&1~;#^dHFVs?%qf+|}s@*B5`=(7W0Z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8G85 zIDGt^$&FGxzd6geew9|{Quik6rz4*v=YFHYz-XS-*{HswYvb;P&d|w;JLXTW2=mWr bozrs1=x5KAIJb|dJ6Df~?P!1E&xrpAi?zEr diff --git a/locales/fr_FR/LC_MESSAGES/main.po b/locales/fr_FR/LC_MESSAGES/main.po index 3432d7f8..af847dd0 100644 --- a/locales/fr_FR/LC_MESSAGES/main.po +++ b/locales/fr_FR/LC_MESSAGES/main.po @@ -1,8 +1,8 @@ msgid "" msgstr "" "Project-Id-Version: Flus\n" -"POT-Creation-Date: 2024-11-13 10:08+0100\n" -"PO-Revision-Date: 2024-11-13 10:08+0100\n" +"POT-Creation-Date: 2024-11-13 11:36+0100\n" +"PO-Revision-Date: 2024-11-13 11:36+0100\n" "Last-Translator: Marien Fressinaud \n" "Language-Team: \n" "Language: fr_FR\n" @@ -18,7 +18,7 @@ msgstr "" #: assets/javascripts/controllers/back_button_controller.js:47 #: views/_layouts/connected.phtml:223 #: views/_layouts/connected_blocked.phtml:181 -#: views/_layouts/not_connected.phtml:149 +#: views/_layouts/not_connected.phtml:150 msgid "Back" msgstr "Retour" @@ -48,7 +48,7 @@ msgstr "Afficher" #: controllers/Collections.php:101 controllers/Collections.php:311 #: controllers/Feeds.php:107 controllers/Groups.php:90 -#: controllers/Links.php:293 controllers/Links.php:465 +#: controllers/Links.php:268 controllers/Links.php:440 #: controllers/Mastodon.php:211 controllers/Mastodon.php:297 #: controllers/News.php:76 controllers/Passwords.php:89 #: controllers/Passwords.php:192 controllers/Registrations.php:103 @@ -60,7 +60,7 @@ msgstr "Afficher" #: controllers/collections/Images.php:114 controllers/collections/Links.php:105 #: controllers/collections/Shares.php:98 controllers/collections/Shares.php:211 #: controllers/links/Messages.php:84 controllers/links/Repairing.php:99 -#: controllers/links/Searches.php:109 controllers/my/Account.php:111 +#: controllers/links/Searches.php:111 controllers/my/Account.php:111 #: controllers/my/Preferences.php:82 controllers/my/Profile.php:73 #: controllers/my/Security.php:93 controllers/my/Security.php:209 #: controllers/my/Subscription.php:74 controllers/my/Validation.php:138 @@ -75,7 +75,7 @@ msgstr "L’une des thématiques associées n’existe pas." #: controllers/Collections.php:386 controllers/Exportations.php:62 #: controllers/Groups.php:161 controllers/Importations.php:48 -#: controllers/Links.php:522 controllers/Mastodon.php:87 +#: controllers/Links.php:497 controllers/Mastodon.php:87 #: controllers/Messages.php:94 controllers/Messages.php:145 #: controllers/Sessions.php:206 controllers/collections/Read.php:87 #: controllers/collections/Read.php:168 controllers/collections/Read.php:243 @@ -100,11 +100,11 @@ msgstr "Aucun flux valide n’a été détecté à cette adresse." msgid "You already have a group with this name." msgstr "Vous avez déjà un groupe portant le même nom." -#: controllers/Links.php:326 +#: controllers/Links.php:301 msgid "The link must be associated to a collection." msgstr "Le lien doit être associé à une collection." -#: controllers/Links.php:343 controllers/links/Collections.php:154 +#: controllers/Links.php:318 controllers/links/Collections.php:154 msgid "One of the associated collection doesn’t exist." msgstr "L’une des collections associées n’existe pas." @@ -624,8 +624,8 @@ msgstr "Se déconnecter" msgid "Search links by words or URL" msgstr "Rechercher des liens par mots ou URL" -#: views/_layouts/connected.phtml:243 views/links/searches/show.phtml:55 -#: views/links/searches/show.phtml:71 +#: views/_layouts/connected.phtml:243 views/links/searches/show.phtml:59 +#: views/links/searches/show.phtml:75 msgid "Search" msgstr "Rechercher" @@ -645,7 +645,7 @@ msgstr "Se connecter" msgid "Choose your language" msgstr "Choisissez votre langue" -#: views/_layouts/not_connected.phtml:162 views/pages/about.phtml:3 +#: views/_layouts/not_connected.phtml:163 views/pages/about.phtml:3 #: views/pages/about.phtml:11 views/support/show.phtml:115 #, php-format msgid "About %s" @@ -683,20 +683,20 @@ msgstr "Page suivante" #: views/alerts/_error.phtml:3 views/collections/edit.phtml:50 #: views/collections/edit.phtml:76 views/collections/edit.phtml:94 #: views/collections/groups/edit.phtml:96 -#: views/collections/images/edit.phtml:60 views/collections/links/new.phtml:41 +#: views/collections/images/edit.phtml:61 views/collections/links/new.phtml:41 #: views/collections/new.phtml:49 views/collections/new.phtml:75 #: views/collections/new.phtml:93 views/collections/shares/index.phtml:53 #: views/collections/shares/index.phtml:101 views/feeds/new.phtml:42 -#: views/groups/edit.phtml:44 views/importations/opml/show.phtml:103 +#: views/groups/edit.phtml:44 views/importations/opml/show.phtml:104 #: views/links/collections/index.phtml:36 #: views/links/collections/index.phtml:43 views/links/edit.phtml:44 #: views/links/edit.phtml:73 views/links/new.phtml:42 views/links/new.phtml:59 #: views/links/new.phtml:66 views/links/repairing/new.phtml:50 -#: views/links/searches/show.phtml:62 views/links/show.phtml:216 +#: views/links/searches/show.phtml:66 views/links/show.phtml:216 #: views/mastodon/show.phtml:77 views/mastodon/show.phtml:132 #: views/messages/edit.phtml:44 views/my/account/deletion.phtml:63 -#: views/my/preferences/edit.phtml:41 views/my/profile/edit.phtml:56 -#: views/my/profile/edit.phtml:92 views/my/security/confirmation.phtml:59 +#: views/my/preferences/edit.phtml:41 views/my/profile/edit.phtml:57 +#: views/my/profile/edit.phtml:93 views/my/security/confirmation.phtml:59 #: views/my/security/show.phtml:41 views/my/security/show.phtml:81 #: views/passwords/edit.phtml:58 views/passwords/forgot.phtml:48 #: views/registrations/new.phtml:51 views/registrations/new.phtml:76 @@ -738,7 +738,7 @@ msgstr "Placez ici les liens que vous souhaitez consulter plus tard." #: views/bookmarks/index.phtml:28 views/collections/_collection.phtml:31 #: views/collections/show.phtml:211 views/collections/show_public.phtml:226 -#: views/links/searches/show.phtml:114 views/news/index.phtml:18 +#: views/links/searches/show.phtml:118 views/news/index.phtml:18 #: views/news/index.phtml:121 views/read/index.phtml:29 #, php-format msgid "%s link" @@ -750,7 +750,7 @@ msgstr[1] "%s liens" msgid "Add a link" msgstr "Ajouter un lien" -#: views/collections/_collection.phtml:18 views/links/searches/show.phtml:109 +#: views/collections/_collection.phtml:18 views/links/searches/show.phtml:113 #, php-format msgid "Feed %s" msgstr "Flux %s" @@ -760,7 +760,7 @@ msgstr "Flux %s" msgid "By %s" msgstr "Par %s" -#: views/collections/_collection.phtml:29 views/links/searches/show.phtml:112 +#: views/collections/_collection.phtml:29 views/links/searches/show.phtml:116 msgid "no links" msgstr "aucun lien" @@ -839,7 +839,7 @@ msgstr "Sa description" #: views/collections/edit.phtml:61 views/collections/new.phtml:60 #: views/links/collections/index.phtml:115 -#: views/links/collections/index.phtml:157 views/my/security/show.phtml:52 +#: views/links/collections/index.phtml:153 views/my/security/show.phtml:52 msgid "(optional)" msgstr "(optionnel)" @@ -858,8 +858,8 @@ msgstr "Afficher la collection publiquement" #: views/collections/edit.phtml:136 views/collections/filters/edit.phtml:90 #: views/collections/groups/edit.phtml:105 views/groups/edit.phtml:53 #: views/links/edit.phtml:82 views/mastodon/show.phtml:86 -#: views/messages/edit.phtml:61 views/my/preferences/edit.phtml:99 -#: views/my/profile/edit.phtml:101 views/my/security/show.phtml:94 +#: views/messages/edit.phtml:57 views/my/preferences/edit.phtml:99 +#: views/my/profile/edit.phtml:102 views/my/security/show.phtml:94 msgid "Save changes" msgstr "Enregistrer les modifications" @@ -941,15 +941,15 @@ msgid "Illustrations help to distinguish your collection among the others." msgstr "" "Les illustrations aident à distinguer votre collection parmi les autres." -#: views/collections/images/edit.phtml:53 +#: views/collections/images/edit.phtml:54 msgid "Upload an image" msgstr "Téléverser une image" -#: views/collections/images/edit.phtml:66 +#: views/collections/images/edit.phtml:67 msgid "PNG or JPG images only." msgstr "Formats PNG ou JPG seulement." -#: views/collections/images/edit.phtml:67 +#: views/collections/images/edit.phtml:68 msgid "The minimum recommended dimensions are 1100x400px." msgstr "Les dimensions minimales recommandées sont de 1100x400px." @@ -1119,12 +1119,12 @@ msgid "Change the illustration" msgstr "Changer l’illustration" #: views/collections/show.phtml:160 views/collections/show_public.phtml:187 -#: views/links/searches/show.phtml:129 +#: views/links/searches/show.phtml:133 msgid "Unfollow" msgstr "Ne plus suivre" #: views/collections/show.phtml:172 views/collections/show_public.phtml:198 -#: views/collections/show_public.phtml:212 views/links/searches/show.phtml:138 +#: views/collections/show_public.phtml:212 views/links/searches/show.phtml:142 msgid "Follow" msgstr "Suivre" @@ -1319,7 +1319,7 @@ msgstr "" msgid "Ok!" msgstr "Ok !" -#: views/importations/opml/show.phtml:96 +#: views/importations/opml/show.phtml:97 msgid "Import a file" msgstr "Importer un fichier" @@ -1521,7 +1521,7 @@ msgid "Read later" msgstr "Lire plus tard" #: views/links/_link.phtml:375 views/links/_link.phtml:379 -#: views/links/collections/index.phtml:199 +#: views/links/collections/index.phtml:191 msgid "Store the link" msgstr "Ranger le lien" @@ -1541,29 +1541,23 @@ msgstr "Vous avez déjà commenté ce lien." msgid "Anything else to add?" msgstr "Des choses à ajouter ?" -#: views/links/collections/index.phtml:129 -#: views/links/collections/index.phtml:171 views/links/show.phtml:223 -#: views/messages/edit.phtml:51 +#: views/links/collections/index.phtml:128 +#: views/links/collections/index.phtml:166 views/links/show.phtml:222 +#: views/messages/edit.phtml:50 msgid "You can format your comment in Markdown and use #tags." msgstr "" "Vous pouvez formater votre commentaire en Markdown et utiliser des #tags." -#: views/links/collections/index.phtml:131 -#: views/links/collections/index.phtml:173 views/links/show.phtml:225 -#: views/messages/edit.phtml:53 -msgid "You can format your comment in Markdown." -msgstr "Vous pouvez formater votre commentaire en Markdown." - -#: views/links/collections/index.phtml:146 -#: views/links/collections/index.phtml:188 views/links/show.phtml:241 +#: views/links/collections/index.phtml:142 +#: views/links/collections/index.phtml:180 views/links/show.phtml:237 msgid "Share on Mastodon" msgstr "Partager vers Mastodon" -#: views/links/collections/index.phtml:155 views/links/show.phtml:198 +#: views/links/collections/index.phtml:151 views/links/show.phtml:198 msgid "What do you think?" msgstr "Qu’en pensez-vous ?" -#: views/links/collections/index.phtml:197 +#: views/links/collections/index.phtml:189 msgid "Store the link and mark as read" msgstr "Ranger le lien et marquer comme lu" @@ -1692,11 +1686,11 @@ msgstr "(ouvre une nouvelle fenêtre)" msgid "Are you sure that you want to delete this message?" msgstr "Êtes-vous sur·e de vouloir supprimer ce message ?" -#: views/links/show.phtml:248 +#: views/links/show.phtml:244 msgid "Comment" msgstr "Commenter" -#: views/links/show.phtml:255 +#: views/links/show.phtml:251 msgid "This link being hidden, the comments are private." msgstr "Ce lien étant masqué, les commentaires sont privés." @@ -1988,11 +1982,11 @@ msgstr "" "Avec les fonctionnalités bêta, vous testez des fonctionnalités avant tout le " "monde, mais vous entrez dans une zone de turbulences." -#: views/my/profile/edit.phtml:49 +#: views/my/profile/edit.phtml:50 msgid "Upload a photo" msgstr "Téléverser une photo" -#: views/my/profile/edit.phtml:62 +#: views/my/profile/edit.phtml:63 msgid "" "PNG or JPG images only, a 150x150 image is " "recommended." @@ -2000,11 +1994,11 @@ msgstr "" "Formats PNG ou JPG seulement, une image de 150x150 " "est recommandée." -#: views/my/profile/edit.phtml:73 +#: views/my/profile/edit.phtml:74 msgid "Your name" msgstr "Votre nom" -#: views/my/profile/edit.phtml:75 views/registrations/new.phtml:32 +#: views/my/profile/edit.phtml:76 views/registrations/new.phtml:32 #, php-format msgid "(public, max. %d characters)" msgstr "(public, max. %d caractères)" @@ -2174,14 +2168,14 @@ msgstr "Bienvenue !" msgid "Welcome %s!" msgstr "Bienvenue %s !" -#: views/onboarding/step1.phtml:49 +#: views/onboarding/step1.phtml:50 #, php-format msgid "The few next screens will explain you some main features of %s." msgstr "" "Les écrans qui suivent vous expliqueront quelques-unes des principales " "fonctionnalités de %s." -#: views/onboarding/step1.phtml:53 +#: views/onboarding/step1.phtml:54 #, php-format msgid "" "There’s not much to know before getting started with %s. This onboarding " @@ -2190,13 +2184,13 @@ msgstr "" "Il n’y a pas grand-chose à savoir avant de pouvoir utiliser %s. Cette " "introduction devrait vous prendre moins de 3 minutes à parcourir." -#: views/onboarding/step1.phtml:58 views/onboarding/step2.phtml:39 +#: views/onboarding/step1.phtml:59 views/onboarding/step2.phtml:39 #: views/onboarding/step3.phtml:29 views/onboarding/step4.phtml:29 #: views/onboarding/step5.phtml:29 msgid "Continue" msgstr "Continuer" -#: views/onboarding/step1.phtml:65 +#: views/onboarding/step1.phtml:66 msgid "or skip the onboarding" msgstr "ou passer l’introduction" diff --git a/src/controllers/Links.php b/src/controllers/Links.php index 24912086..4318dd51 100644 --- a/src/controllers/Links.php +++ b/src/controllers/Links.php @@ -37,25 +37,13 @@ public function index(Request $request): Response return Response::redirect('login', ['redirect_to' => \Minz\Url::for('links')]); } - $beta_enabled = models\FeatureFlag::isEnabled('beta', $user->id); - $query = $request->param('q'); $pagination_page = $request->paramInteger('page', 1); if ($query) { - if ($beta_enabled) { - $search_query = search_engine\Query::fromString($query); - - $number_links = search_engine\LinksSearcher::countLinks($user, $search_query); - } else { - $number_links = models\Link::countByQueryAndUserId( - $query, - $user->id, - [ - 'exclude_never_only' => true, - ] - ); - } + $search_query = search_engine\Query::fromString($query); + + $number_links = search_engine\LinksSearcher::countLinks($user, $search_query); $number_per_page = 30; @@ -68,27 +56,14 @@ public function index(Request $request): Response ]); } - if ($beta_enabled) { - $links = search_engine\LinksSearcher::getLinks( - $user, - $search_query, - pagination: [ - 'offset' => $pagination->currentOffset(), - 'limit' => $pagination->numberPerPage(), - ] - ); - } else { - $links = models\Link::listComputedByQueryAndUserId( - $query, - $user->id, - ['published_at', 'number_comments'], - [ - 'exclude_never_only' => true, - 'offset' => $pagination->currentOffset(), - 'limit' => $pagination->numberPerPage(), - ] - ); - } + $links = search_engine\LinksSearcher::getLinks( + $user, + $search_query, + pagination: [ + 'offset' => $pagination->currentOffset(), + 'limit' => $pagination->numberPerPage(), + ] + ); return Response::ok('links/search.phtml', [ 'links' => $links, diff --git a/src/models/dao/Link.php b/src/models/dao/Link.php index b04d6fae..ac38fa8f 100644 --- a/src/models/dao/Link.php +++ b/src/models/dao/Link.php @@ -22,7 +22,6 @@ trait Link use links\FetcherQueries; use links\NewsQueries; use links\PocketQueries; - use links\SearchQueries; use Database\Lockable; /** diff --git a/src/models/dao/links/SearchQueries.php b/src/models/dao/links/SearchQueries.php deleted file mode 100644 index df4c3657..00000000 --- a/src/models/dao/links/SearchQueries.php +++ /dev/null @@ -1,190 +0,0 @@ - - * @license http://www.gnu.org/licenses/agpl-3.0.en.html AGPL - */ -trait SearchQueries -{ - /** - * Search links of the given user with its computed properties. - * - * This method uses PGSQL full text search feature. - * - * Links are sorted by published_at if the property is included, or by - * created_at otherwise. - * - * @see https://www.postgresql.org/docs/current/textsearch.html - * - * @param string $query - * The query to search for. - * @param string $user_id - * The user id the links must match. - * @param string[] $selected_computed_props - * The list of computed properties to return. It is mandatory to - * select specific properties to avoid computing dispensable - * properties. - * @param array{ - * 'exclude_never_only'?: bool, - * 'offset'?: int, - * 'limit'?: int|'ALL', - * } $options - * - * Description of the options: - * - * - exclude_never_only (default to false), whether we should exclude links - * that are only in a "never" collection - * - offset (default to 0), the offset for pagination - * - limit (default to 'ALL') the limit for pagination - * - * @return self[] - */ - public static function listComputedByQueryAndUserId( - string $query, - string $user_id, - array $selected_computed_props, - array $options = [], - ): array { - $default_options = [ - 'exclude_never_only' => false, - 'offset' => 0, - 'limit' => 'ALL', - ]; - $options = array_merge($default_options, $options); - - $parameters = [ - ':user_id' => $user_id, - ':query' => $query, - ':offset' => $options['offset'], - ]; - - $published_at_clause = ''; - $order_by_clause = 'ORDER BY l.created_at DESC, l.id'; - if (in_array('published_at', $selected_computed_props)) { - $published_at_clause = ', l.created_at AS published_at'; - $order_by_clause = 'ORDER BY published_at DESC, l.id'; - } - - $number_comments_clause = ''; - if (in_array('number_comments', $selected_computed_props)) { - $number_comments_clause = <<<'SQL' - , ( - SELECT COUNT(*) FROM messages m - WHERE m.link_id = l.id - ) AS number_comments - SQL; - } - - $exclude_clause = ''; - if ($options['exclude_never_only']) { - $exclude_clause = <<<'SQL' - AND NOT EXISTS ( - SELECT 1 - FROM links_to_collections lc, collections c - - WHERE lc.link_id = l.id - AND lc.collection_id = c.id - - HAVING COUNT(CASE WHEN c.type='never' THEN 1 END) = 1 - AND COUNT(c.*) = 1 - ) - SQL; - } - - $limit_clause = ''; - if ($options['limit'] !== 'ALL') { - $limit_clause = 'LIMIT :limit'; - $parameters[':limit'] = $options['limit']; - } - - $sql = <<prepare($sql); - $statement->execute($parameters); - - return self::fromDatabaseRows($statement->fetchAll()); - } - - /** - * Return the number of links matching with query and user_id. - * - * @param string $query - * The query to search for. - * @param string $user_id - * The user id the links must match. - * @param array{ - * 'exclude_never_only'?: bool, - * } $options - * - * Description of the options: - * - * - exclude_never_only (default to false), whether we should exclude links - * that are only in a "never" collection - * - * @return integer - */ - public static function countByQueryAndUserId(string $query, string $user_id, array $options = []): int - { - $default_options = [ - 'exclude_never_only' => false, - ]; - $options = array_merge($default_options, $options); - - $parameters = [ - ':user_id' => $user_id, - ':query' => $query, - ]; - - $exclude_clause = ''; - if ($options['exclude_never_only']) { - $exclude_clause = <<<'SQL' - AND NOT EXISTS ( - SELECT 1 - FROM links_to_collections lc, collections c - - WHERE lc.link_id = l.id - AND lc.collection_id = c.id - - HAVING COUNT(CASE WHEN c.type='never' THEN 1 END) = 1 - AND COUNT(c.*) = 1 - ) - SQL; - } - - $sql = <<prepare($sql); - $statement->execute($parameters); - - return intval($statement->fetchColumn()); - } -} diff --git a/src/views/links/_link.phtml b/src/views/links/_link.phtml index e2a071a5..b2137f85 100644 --- a/src/views/links/_link.phtml +++ b/src/views/links/_link.phtml @@ -182,7 +182,7 @@

- tags && $beta_enabled): ?> + tags): ?> @@ -167,11 +163,7 @@ >

- - - - - +

diff --git a/src/views/links/show.phtml b/src/views/links/show.phtml index 9f9ca4b0..13af3611 100644 --- a/src/views/links/show.phtml +++ b/src/views/links/show.phtml @@ -57,7 +57,7 @@ - tags && $beta_enabled): ?> + tags): ?>
diff --git a/src/views/messages/edit.phtml b/src/views/messages/edit.phtml index bb7a49e1..138033ec 100644 --- a/src/views/messages/edit.phtml +++ b/src/views/messages/edit.phtml @@ -47,11 +47,7 @@

- - - - - +

diff --git a/tests/models/dao/links/SearchQueriesTest.php b/tests/models/dao/links/SearchQueriesTest.php deleted file mode 100644 index 6be0c288..00000000 --- a/tests/models/dao/links/SearchQueriesTest.php +++ /dev/null @@ -1,246 +0,0 @@ -fake('sentence', 10, false); - $query = $title; - $user = UserFactory::create(); - $link = LinkFactory::create([ - 'user_id' => $user->id, - 'title' => $title, - ]); - - $links = models\Link::listComputedByQueryAndUserId($query, $user->id, []); - - $this->assertSame(1, count($links)); - $this->assertSame($link->id, $links[0]->id); - } - - public function testSearchComputedByUserIdSearchesByUrl(): void - { - /** @var string */ - $url = $this->fake('url'); - $query = $url; - $user = UserFactory::create(); - $link = LinkFactory::create([ - 'user_id' => $user->id, - 'url' => $url, - ]); - - $links = models\Link::listComputedByQueryAndUserId($query, $user->id, []); - - $this->assertSame(1, count($links)); - $this->assertSame($link->id, $links[0]->id); - } - - public function testSearchComputedByUserIdSortsByCreatedAt(): void - { - /** @var string */ - $title = $this->fake('sentence', 10, false); - $query = $title; - $user = UserFactory::create(); - $created_at_1 = \Minz\Time::ago(1, 'day'); - $created_at_2 = \Minz\Time::ago(2, 'day'); - $link_1 = LinkFactory::create([ - 'user_id' => $user->id, - 'title' => $title, - 'created_at' => $created_at_1, - ]); - $link_2 = LinkFactory::create([ - 'user_id' => $user->id, - 'title' => $title, - 'created_at' => $created_at_2, - ]); - - $links = models\Link::listComputedByQueryAndUserId($query, $user->id, []); - - $this->assertSame(2, count($links)); - $this->assertSame($link_1->id, $links[0]->id); - $this->assertSame($link_2->id, $links[1]->id); - } - - public function testSearchComputedByUserIdCanReturnPublishedAt(): void - { - /** @var string */ - $title = $this->fake('sentence', 10, false); - $query = $title; - $user = UserFactory::create(); - /** @var \DateTimeImmutable */ - $published_at = $this->fake('dateTime'); - $link = LinkFactory::create([ - 'user_id' => $user->id, - 'title' => $title, - 'created_at' => $published_at, - ]); - - $links = models\Link::listComputedByQueryAndUserId($query, $user->id, ['published_at']); - - $this->assertSame(1, count($links)); - $this->assertEquals($published_at, $links[0]->published_at); - } - - public function testSearchComputedByUserIdCanReturnNumberComments(): void - { - /** @var string */ - $title = $this->fake('sentence', 10, false); - $query = $title; - $user = UserFactory::create(); - $link = LinkFactory::create([ - 'user_id' => $user->id, - 'title' => $title, - ]); - MessageFactory::create([ - 'link_id' => $link->id, - ]); - - $links = models\Link::listComputedByQueryAndUserId($query, $user->id, ['number_comments']); - - $this->assertSame(1, count($links)); - $this->assertSame(1, $links[0]->number_comments); - } - - public function testSearchComputedByUserIdCanLimitResults(): void - { - /** @var string */ - $title = $this->fake('sentence', 10, false); - $query = $title; - $user = UserFactory::create(); - $link_1 = LinkFactory::create([ - 'user_id' => $user->id, - 'created_at' => \Minz\Time::ago(3, 'days'), - 'title' => $title, - 'url' => 'https://example.com/foo1', // urls must be of the same lenght - ]); - $link_2 = LinkFactory::create([ - 'user_id' => $user->id, - 'created_at' => \Minz\Time::ago(2, 'days'), - 'title' => $title, - 'url' => 'https://example.com/foo2', // urls must be of the same lenght - ]); - $link_3 = LinkFactory::create([ - 'user_id' => $user->id, - 'created_at' => \Minz\Time::ago(1, 'days'), - 'title' => $title, - 'url' => 'https://example.com/foo3', // urls must be of the same lenght - ]); - - $links = models\Link::listComputedByQueryAndUserId($query, $user->id, [], [ - 'limit' => 2, - ]); - - $this->assertSame(2, count($links)); - $this->assertSame($link_3->id, $links[0]->id); - $this->assertSame($link_2->id, $links[1]->id); - } - - public function testSearchComputedByUserIdCanOffsetResults(): void - { - /** @var string */ - $title = $this->fake('sentence', 10, false); - $query = $title; - $user = UserFactory::create(); - $link_1 = LinkFactory::create([ - 'user_id' => $user->id, - 'created_at' => \Minz\Time::ago(3, 'days'), - 'title' => $title, - 'url' => 'https://example.com/foo1', // urls must be of the same lenght - ]); - $link_2 = LinkFactory::create([ - 'user_id' => $user->id, - 'created_at' => \Minz\Time::ago(2, 'days'), - 'title' => $title, - 'url' => 'https://example.com/foo2', // urls must be of the same lenght - ]); - $link_3 = LinkFactory::create([ - 'user_id' => $user->id, - 'created_at' => \Minz\Time::ago(1, 'days'), - 'title' => $title, - 'url' => 'https://example.com/foo3', // urls must be of the same lenght - ]); - - $links = models\Link::listComputedByQueryAndUserId($query, $user->id, [], [ - 'offset' => 1, - ]); - - $this->assertSame(2, count($links)); - $this->assertSame($link_2->id, $links[0]->id); - $this->assertSame($link_1->id, $links[1]->id); - } - - public function testSearchComputedByUserIdCanExcludeLinksOnlyInNeverCollection(): void - { - /** @var string */ - $title = $this->fake('sentence', 10, false); - $query = $title; - $user = UserFactory::create(); - $user = $user->reload(); - $never_list = $user->neverList(); - $link = LinkFactory::create([ - 'user_id' => $user->id, - 'title' => $title, - ]); - LinkToCollectionFactory::create([ - 'collection_id' => $never_list->id, - 'link_id' => $link->id, - ]); - - $links = models\Link::listComputedByQueryAndUserId($query, $user->id, [], [ - 'exclude_never_only' => true, - ]); - - $this->assertSame(0, count($links)); - } - - public function testCountByQueryAndUserId(): void - { - /** @var string */ - $title = $this->fake('sentence', 10, false); - $query = $title; - $user = UserFactory::create(); - $link = LinkFactory::create([ - 'user_id' => $user->id, - 'title' => $title, - ]); - - $count = models\Link::countByQueryAndUserId($query, $user->id); - - $this->assertSame(1, $count); - } - - public function testCountByQueryAndUserIdCanExcludeLinksOnlyInNeverCollection(): void - { - /** @var string */ - $title = $this->fake('sentence', 10, false); - $query = $title; - $user = UserFactory::create(); - $never_list = $user->neverList(); - $link = LinkFactory::create([ - 'user_id' => $user->id, - 'title' => $title, - ]); - LinkToCollectionFactory::create([ - 'collection_id' => $never_list->id, - 'link_id' => $link->id, - ]); - - $count = models\Link::countByQueryAndUserId($query, $user->id, [ - 'exclude_never_only' => true, - ]); - - $this->assertSame(0, $count); - } -}