diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 076fbe66f..d36e1946d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,12 +5,16 @@ on: [push] jobs: build-test: runs-on: ubuntu-latest + timeout-minutes: 10 continue-on-error: ${{ matrix.experimental }} strategy: fail-fast: false matrix: - php_version: [7.2, 7.3, 7.4] + php_version: ["7.2", "7.3", "7.4", "8.0"] experimental: [false] + include: + - php_version: "8.1" + experimental: true steps: - name: Check out repository code @@ -43,7 +47,7 @@ jobs: php_extensions: gettext intl xsl pcov - name: Run PHPUnit tests - uses: php-actions/phpunit@91ff02a58932e63741157ea8c04e7e7077233537 + uses: php-actions/phpunit@v3 env: LANGUAGE: fr with: @@ -51,6 +55,7 @@ jobs: php_version: ${{ matrix.php_version }} php_extensions: gettext intl xsl pcov memory_limit: 512M + configuration: phpunit.xml - name: Publish code coverage to Code Climate uses: paambaati/codeclimate-action@v2.7.5 @@ -58,6 +63,10 @@ jobs: CC_TEST_REPORTER_ID: fb98170a5c7ea9cc2bbab19ff26268335e6a11a4f8267ca935e5e8ff4624886c with: prefix: /app + # PHPUnit 8.5 doesn't support code coverage for PHP 8 + if: ${{ matrix.php_version < '8.0' }} - name: Publish code coverage to Codecov uses: codecov/codecov-action@v1 + # PHPUnit 8.5 doesn't support code coverage for PHP 8 + if: ${{ matrix.php_version < '8.0' }} diff --git a/composer.json b/composer.json index 2f1f9d3e5..94e6c410b 100644 --- a/composer.json +++ b/composer.json @@ -65,7 +65,7 @@ "twig/extensions": "1.5.*", "twitter/bootstrap": "3.3.*", "twitter/typeahead.js": "v0.10.5", - "willdurand/negotiation": "2.3.*", + "willdurand/negotiation": "3.0.*", "vakata/jstree": "3.3.*", "punic/punic": "3.5.1", "ml/json-ld": "1.*", @@ -83,8 +83,8 @@ "require-dev": { "phpunit/phpunit": "8.5.*", "umpirsky/twig-gettext-extractor": "1.3.*", - "symfony/dom-crawler": "3.4.3", - "mockery/mockery": "1.3.1" + "symfony/dom-crawler": "5.4.*", + "mockery/mockery": "1.3.5" }, "autoload": { "classmap": ["controller/", "model/", "model/sparql/"] diff --git a/model/Vocabulary.php b/model/Vocabulary.php index 44716969e..afe731b54 100644 --- a/model/Vocabulary.php +++ b/model/Vocabulary.php @@ -423,7 +423,7 @@ public function getConceptBroaders($uri, $lang) * @param boolean $any set to true if you want to have a label even in case of a correct language one missing. * @param string $lang language identifier. */ - public function getConceptTransitiveBroaders($uri, $limit, $any = false, $lang) + public function getConceptTransitiveBroaders($uri, $limit, $any, $lang) { $lang = $lang ? $lang : $this->getEnvLang(); $fallback = $this->config->getDefaultLanguage(); diff --git a/model/sparql/GenericSparql.php b/model/sparql/GenericSparql.php index 6605102aa..ccf40b30b 100644 --- a/model/sparql/GenericSparql.php +++ b/model/sparql/GenericSparql.php @@ -1198,13 +1198,13 @@ private function transformConceptSearchResults($results, $vocabs, $fields) { /** * Query for concepts using a search term. * @param array $vocabs array of Vocabulary objects to search; empty for global search - * @param array $fields extra fields to include in the result (array of strings). (default: null = none) - * @param boolean $unique restrict results to unique concepts (default: false) - * @param boolean $showDeprecated whether to include deprecated concepts in the result (default: false) + * @param array $fields extra fields to include in the result (array of strings or null). + * @param boolean $unique restrict results to unique concepts * @param ConceptSearchParameters $params + * @param boolean $showDeprecated whether to include deprecated concepts in the result (default: false) * @return array query result object */ - public function queryConcepts($vocabs, $fields = null, $unique = false, $params, $showDeprecated = false) { + public function queryConcepts($vocabs, $fields, $unique, $params, $showDeprecated = false) { $query = $this->generateConceptSearchQuery($fields, $unique, $params,$showDeprecated); $results = $this->query($query); return $this->transformConceptSearchResults($results, $vocabs, $fields); diff --git a/phpunit.xml b/phpunit.xml index 8e6fc2a7b..f266bce76 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,4 +1,5 @@ - + diff --git a/tests/bootstrap.php b/tests/bootstrap.php index f8175a878..e5e54e6bb 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -1,5 +1,7 @@