Skip to content

Commit

Permalink
Merge pull request #1312 from NatLibFi/issue1291-phpunit-9
Browse files Browse the repository at this point in the history
Upgrade to PHPUnit 9, drop PHP 7.2 support
  • Loading branch information
osma authored Apr 28, 2022
2 parents fc1bd5a + 50965a4 commit 712ead2
Showing 5 changed files with 22 additions and 25 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php_version: ["7.2", "7.3", "7.4", "8.0"]
php_version: ["7.3", "7.4", "8.0"]
experimental: [false]
include:
- php_version: "8.1"
@@ -55,7 +55,7 @@ jobs:
env:
LANGUAGE: fr
with:
version: 8.5
version: 9.5
php_version: ${{ matrix.php_version }}
php_extensions: gettext intl xsl pcov
memory_limit: 512M
@@ -67,10 +67,6 @@ 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' }}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -69,7 +69,7 @@
"grimmlink/qtip2": "3.0.3"
},
"require-dev": {
"phpunit/phpunit": "8.5.*",
"phpunit/phpunit": "9.5.*",
"umpirsky/twig-gettext-extractor": "1.3.*",
"symfony/dom-crawler": "5.4.*",
"mockery/mockery": "1.3.5"
33 changes: 17 additions & 16 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
<phpunit colors="true" bootstrap="tests/bootstrap.php" processIsolation="true"
convertDeprecationsToExceptions="true">
<logging>
<log type="coverage-html" target="./report" lowUpperBound="35" highLowerBound="70"/>
<log type="coverage-clover" target="build/logs/clover.xml"/>
</logging>
<?xml version="1.0"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" colors="true" bootstrap="tests/bootstrap.php" processIsolation="true" convertDeprecationsToExceptions="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">controller</directory>
<directory suffix=".php">model</directory>
<directory suffix=".php">model/sparql</directory>
</include>
<exclude>
<directory>vendor</directory>
</exclude>
<report>
<clover outputFile="build/logs/clover.xml"/>
<html outputDirectory="./report" lowUpperBound="35" highLowerBound="70"/>
</report>
</coverage>
<logging/>
<testsuites>
<testsuite name="tests">
<directory suffix=".php">tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">controller</directory>
<directory suffix=".php">model</directory>
<directory suffix=".php">model/sparql</directory>
<exclude>
<directory>vendor</directory>
</exclude>
</whitelist>
</filter>
</phpunit>
2 changes: 1 addition & 1 deletion tests/ConceptTest.php
Original file line number Diff line number Diff line change
@@ -307,7 +307,7 @@ public function testGetDateWithCreatedAndModified() {
* @covers ConceptPropertyValueLiteral::getLabel
*/
public function testGetTimestampInvalidWarning() {
$this->expectException(PHPUnit\Framework\Error\Error::class);
$this->expectError();
$vocab = $this->model->getVocabulary('test');
$concepts = $vocab->getConceptInfo("http://www.skosmos.skos/test/ta114", "en");
$concept = $concepts[0];
2 changes: 1 addition & 1 deletion tests/VocabularyConfigTest.php
Original file line number Diff line number Diff line change
@@ -328,7 +328,7 @@ public function testShowDeprecatedChanges() {
}

/**
* @covers VocabularyConfig::sortByNotation
* @covers VocabularyConfig::getSortByNotation
* @covers VocabularyConfig::getBoolean
*/
public function testShowSortByNotationDefaultValue() {

0 comments on commit 712ead2

Please sign in to comment.