Commit Graph

7 Commits

Author SHA1 Message Date
Marien Fressinaud
8f5d8af72f tec: Fix test suite (#2721)
* Rework the travis file to enable PHPUnit

I realized that unit tests weren't executed on Travis. While working on
this file to enable these tests, I started to think we could simplify
it.

I separated jobs so:

- PHP linter and tests are only performed on PHP 7.3
- Translations are tested separatly so they can fail (it was already the
  case but it was hard to understand the way it was done)
- PHP 5.6 only checks syntax issues
- the last job checks css, js, etc. (it didn't change)

PHPUnit is not executed on 5.6 because only the version 5 is available
while the latest version is the 8 (https://phpunit.de/supported-versions.html).

I think it's easier to read (each job is more explicit) but I'm not a
Travis expert so maybe there's some room for improvements.

* Fix failing tests

The category `_name` regression was introduced in commit b323ed084.

I wasn't able to understand when and why Search tests was wrong.

The rest is about upgrade of PHPUnit.
2019-12-23 11:00:22 +01:00
Frans de Jonge
4e174ed9dd [ci] Add Travis (#1619)
* [ci] Add Travis

* Exclude some libs

* Semi-auto whitespace fixes

* line length in SQLite

* Exclude tests from line length

* Feed.php line length

* Feed.php: get rid of unnecessary concat

* Feed.php: line length

* bootstrap.php: no newline at end of file

* Allow concatenating across multiple lines

* Add Travis badge

* do-install line length

* update-or-create-user line length

* cli/create-user line length

* tests/app/Models/SearchTest.php fix indentation

* tests/app/Models/UserQueryTest.php fix indentation

* tests/app/Models/CategoryTest.php fix indentation

* [fix] PHP 5.3 on precise

* cli/do-install no spaces

* cli/list-users line length

* cli/reconfigure line length

* empty catch statements

* api/index line length nonsense

* spaces before semicolon

* app/Models/EntryDAO bunch of indentation

* extra blank lines

* spaces before comma in function call

* testing tabwidth

* increase to 10

* comment out tabwidth line

* try older phpcs version 3.0.0RC4

* line length exception for app/install.php

* proper spaces

* stray spaces in i18n

* Minz/ModelPdo line length

* Minz whitespace

* greader line length

* greader elseif placement

* app/Models/Feed.php spacing in function argument

* ignore php 5.3

* app/Models/ConfigurationSetter.php stray whitespace

* EntryDAOSQLite line length

* I vote for higher max line length =P

* ignore SQL

* remove classname complaint

* line length/more legible SQL

* ignore line length nonsense

* greader line length

* feedController issues

* uppercase TRUE, FALSE, NULL

* revert

* importExportController lowercase null

* Share.php default value not necessary because ! is_array () a few lines down

* CategoryDAO constants should be UPPERCASE

* EntryDAO reduce line length

* contentious autofix

* Allow failures on all versions of PHP except 7.1 because reasons
2017-09-22 12:13:46 +02:00
Alexandre Alapetite
d9c0d25b85 Improve search: intitle, author, inurl
Allow multiple values of intitle: , author:, inurl:

Note: Tests for UserQueryTest are broken due to
https://github.com/sebastianbergmann/phpunit/wiki/Release-Announcement-for-PHPUnit-4.0.0#backwards-compatibility-issues
2017-04-01 22:31:12 +02:00
Alexis Degrugillier
d229216ccc Split the search into values
Before, the search was a single value.
Now it is splited in chuncks when separated by spaces.
Except if they are enclosed by single quotes or double quotes.

For some reasons, the unit tests are working for both single and double quotes but the
search box isn't. It is working only with single quotes.
We need to investigate the reason of this behavior.

See #823
2015-04-22 00:24:22 -04:00
Alexis Degrugillier
50b6a02578 Add search default raw value
Before, the default value was undefined. Now it always has a value even when no value is provided.
2015-02-21 09:46:25 -05:00
Alexis Degrugillier
964e67d4a4 Add a test to verify if the search input is stored correctly 2015-02-12 21:08:37 -05:00
Alexis Degrugillier
f30ded2f86 Extract the search code from the context
I figured that the code for the search could be extracted from the context to have separation of concern.
It supports multiple keywords. It suports also multiple tag keywords.
2015-02-11 21:49:21 -05:00