aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/LinkDBTest.php
Commit message (Collapse)AuthorAgeFilesLines
* 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>