aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/LinkDBTest.php
Commit message (Collapse)AuthorAgeFilesLines
* namespacing: \Shaarli\Bookmark\LinkDBVirtualTam2019-01-121-647/+0
| | | | Signed-off-by: VirtualTam <virtualtam@flibidi.net>
* namespacing: \Shaarli\Feed\{Cache,CachedPage,FeedBuilder}VirtualTam2019-01-121-3/+1
| | | | Signed-off-by: VirtualTam <virtualtam@flibidi.net>
* namespacing: \Shaarli\Exceptions\IOExceptionVirtualTam2019-01-121-1/+3
| | | | Signed-off-by: VirtualTam <virtualtam@flibidi.net>
* lint: apply phpcbf to tests/VirtualTam2018-12-021-3/+3
| | | | Signed-off-by: VirtualTam <virtualtam@flibidi.net>
* Add a button to set links as stickyArthurHoaro2018-10-061-4/+6
| | | | | | Meaning that they always appear on top of all links Fixes #186
* Tag sort - UT + comment + fix filter and visibilityArthurHoaro2018-05-291-0/+100
| | | | Before this, linksCountPerTag call without would have ignored visibility parameter
* Move tag renaming code to LinkDB and unit test itArthurHoaro2017-08-051-0/+55
|
* Merge pull request #841 from ArthurHoaro/feature/search-no-tagArthurHoaro2017-05-251-1/+1
|\ | | | | Empty tag search will look for not tagged links
| * Empty tag search will look for not tagged linksArthurHoaro2017-05-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | Fixes #784 From now, searching for tags with an empty value will return only not tagged links, with the search bar showing `x results [not tagged]`. Note that using the api, the searchtags request parameter must be set to `false` to get the same result. - [ ] Update API doc
* | Adding ability to display subtags in tagcloudLucas Cimon2017-05-241-2/+29
| |
* | Move database read/write to FileUtils class + additional unit testsArthurHoaro2017-03-211-1/+1
|/
* Add a persistent 'shorturl' key to all linksArthurHoaro2016-12-121-11/+11
| | | | | | | All existing link will keep their permalinks. New links will have smallhash generated with date+id. The purpose of this is to avoid collision between links due to their creation date.
* Unit Test for the new ID systemArthurHoaro2016-12-121-6/+33
|
* LinkDB: update datastore method namesVirtualTam2016-10-201-4/+4
| | | | | | Relates to https://github.com/shaarli/Shaarli/issues/95 Signed-off-by: VirtualTam <virtualtam@flibidi.net>
* LinkDB: do not prefix privates with an underscoreVirtualTam2016-10-201-2/+2
| | | | | | Relates to #95 Signed-off-by: VirtualTam <virtualtam@flibidi.net>
* Better whitespace handling in tagsArthurHoaro2016-08-021-26/+4
| | | | | | Correct PR #573 to work properly with hidden tags, and add ReferenceLinkDB UT. Fixes #571 - Closes #573
* add unit testChris Kuethe2016-08-021-0/+26
|
* Merge pull request #558 from ArthurHoaro/hashtag4Arthur2016-07-091-1/+3
|\ | | | | Hashtag system
| * Hashtag systemArthurHoaro2016-06-061-1/+3
| | | | | | | | | | | | * Hashtag are auto-linked with a filter search * Supports unicode * Compatible with markdown (excluded in code blocks)
* | Merge pull request #570 from ArthurHoaro/config-managerArthur2016-07-091-1/+1
|\ \ | |/ |/| Introduce a configuration manager
| * Replace $GLOBALS configuration with the configuration manager in the whole ↵ArthurHoaro2016-06-111-1/+1
| | | | | | | | code base
* | Merge pull request #583 from ArthurHoaro/enhance/tag-caseArthur2016-06-031-2/+4
|\ \ | |/ |/| Fixes #497: ignore case difference between tags
| * Fixes #497: ignore case difference between tagsArthurHoaro2016-05-311-2/+4
| | | | | | | | | | | | | | | | While retrieving all tags, case differences will be ignored. This affects: * tag cloud * tag autocompletion
* | Fixes #480: add an option to urlencode redirector URLArthurHoaro2016-04-091-0/+7
|/ | | | | | | | * New config: `$GLOBALS['config']['REDIRECTOR_URLENCODE']` (default `true`). * Parameter added to LinkDB constructor. * Fixes a bug with urlencode and escaped url. * In `index.php`, LinkDB is now instanciate once for `importFile()` and `showDaily()`. * TU
* Refactor filter in LinkDBArthurHoaro2016-03-251-4/+52
| | | | | | | | * search type now carried by LinkDB in order to factorize code between different search sources. * LinkDB->filter split in 3 method: filterSearch, filterHash, filterDay (we know what type of filter is needed). * filterHash now throw a LinkNotFoundException if it doesn't exist: internal implementation choice, still displays a 404. * Smallhash regex has been rewritten. * Unit tests update
* Support text search across link fields.ArthurHoaro2016-02-151-0/+1
|
* Improved search: combine AND, exact terms and exclude search.ArthurHoaro2016-02-151-0/+1
|
* Private/Hidden tagsArthurHoaro2016-02-151-0/+19
| | | | | | | Tags starting with a dot '.' are now private. They can only be seen and searched when logged in. Fixes #315
* Add exclusion in tag searchArthurHoaro2016-02-151-2/+4
| | | | | | | | | | | * Searching '-mytag' will now exlude all shaares with 'mytag' tag. * All tags starting with a '-' are renamed without it (through the Updater). * Unit tests. Minor code changes: * LinkDB->filter() can now take no parameters (get all link depending on logged status). * tagsStrToArray() is now static and filters blank tags.
* Link filter refactoringArthurHoaro2016-01-061-208/+21
| | | | | | | | | | * introduce class LinkFilter to handle link filter operation (and lighten LinkDB). * handle 'private only' in filtering. * update template to prefill search fields with current search terms. * coding style. * unit test (mostly move from LinkDB to LinkFilter). PS: preparation for #358 #315 and 'AND' search.
* application: refactor version checks, move to ApplicationUtilsVirtualTam2015-11-261-1/+1
| | | | | | | | | | | | | | | Relates to #372 Modifications: - move checkUpdate() to ApplicationUtils - reduce file I/O operations during version checks - apply coding conventions - add test coverage Tools: - create a sandbox directory for tests Signed-off-by: VirtualTam <virtualtam@flibidi.net>
* URL encode links when a redirector is set.ArthurHoaro2015-11-261-0/+23
| | | | | | | | | | | | | | | | | Fixes #328 - URL encode links when a redirector is set * WARNING - template edit - new variable available : "real_url" Contains the final real url (redirected or any other change on original URL) * Don't redirect shaares link in RSS/Atom. * Affects links shaared in description. * Move text2clickable and keepMultipleSpaces to Utils.php + unit test UPDATE: * keepMultipleSpaces renamed to space2nbsp * space2nbsp improved to handle single space at line beginning * links in text description aren't 'nofollow' anymore
* install: check file/directory permissions for Shaarli resourcesVirtualTam2015-11-241-2/+3
| | | | | | | | | | | | | | | | | | | | | | | Relates to #40 Relates to #372 Additions: - FileUtils: IOException - ApplicationUtils: - check if Shaarli resources are accessible with sufficient permissions - basic test coverage - index.php: - check access permissions and redirect to an error page if needed: - before running the first installation Modifications: - LinkDB: - factorize datastore write code - check if the datastore (exists AND is writeable) OR (doesn't exist AND its parent dir is writable) - raise an IOException if needed Signed-off-by: VirtualTam <virtualtam@flibidi.net>
* CachedPage: move to a proper file, add testsVirtualTam2015-08-131-6/+2
| | | | | | | | | | | | Modifications - rename `pageCache` to `CachedPage` - move utilities to `Cache` - do not access globals - apply coding rules - update LinkDB and test code - add test coverage Signed-off-by: VirtualTam <virtualtam@flibidi.net>
* PHP: ensure 5.3 compatibility, refactor timezone utilitiesVirtualTam2015-07-131-6/+6
| | | | | | | | | | | | | | | | | Relates to #250 Modifications - supported version - bump required version from 5.1.0 to 5.3.x - update README - add PHP 5.3 to Travis environments - rewrite array declarations: explicitely use array() instead of [] - move checkPHPVersion to application/Utils.php - move timezone functions to application/TimeZone.php - cleanup code - improve test coverage Signed-off-by: VirtualTam <virtualtam@flibidi.net>
* LinkDB: prefix private members with an underscoreVirtualTam2015-07-091-2/+2
| | | | | | Relates to #95, #218 Signed-off-by: VirtualTam <virtualtam@flibidi.net>
* LinkDB::filterDay(): check input date formatVirtualTam2015-07-091-10/+13
| | | | Signed-off-by: VirtualTam <virtualtam@flibidi.net>
* LinkDBTest: only check that the datastore is created and non-emptyVirtualTam2015-06-281-10/+4
| | | | | | | Fixes #252 Relates to #238 Signed-off-by: VirtualTam <virtualtam@flibidi.net>
* Merge remote-tracking branch 'ArthurHoaro/default-links'nodiscc2015-06-261-7/+7
|\
| * Fixes unit tests: checking datastore filesize instead of hash.ArthurHoaro2015-06-241-7/+7
| | | | | | | | date() makes the hash validation worthless because it changes at every generation.
* | LinkDB: do not access global variablesVirtualTam2015-06-241-19/+13
|/ | | | | | | | | | | Relates to #218 Removes "hidden" access to the following variables: - $GLOBALS['config']['datastore'] - PHPPREFIX - PHPSUFFIX Signed-off-by: VirtualTam <virtualtam@flibidi.net>
* LinkDB: add 'hidePublicLinks' parameter to the constructorVirtualTam2015-06-241-10/+27
| | | | | | | Fixes #236 Relates to #237 Signed-off-by: VirtualTam <virtualtam@flibidi.net>
* LinkDB: move to a proper file, add test coverageVirtualTam2015-06-111-0/+509
Relates to #71 LinkDB - move to application/LinkDB.php - code cleanup - indentation - whitespaces - formatting - comment cleanup - add missing documentation - unify formatting Test coverage for LinkDB - constructor - public / private access - link-related methods Shaarli utilities (LinkDB dependencies) - move startsWith() and endsWith() functions to application/Utils.php - add test coverage Dev utilities - Composer: add PHPUnit to dev dependencies - Makefile: - update lint targets - add test targets - generate coverage reports Signed-off-by: VirtualTam <virtualtam@flibidi.net>