Skip to content

Commit

Permalink
API Migrate to PHPUnit 9
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxime Rainville committed Oct 28, 2021
1 parent f4e9207 commit 15aff1b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 45 deletions.
34 changes: 3 additions & 31 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,4 @@
language: php
version: ~> 1.0

services:
- mysql

env:
global:
- TRAVIS_NODE_VERSION="10"

matrix:
include:
- php: 7.2
env: DB=MYSQL SYMFONY_VERSION=^4 FRAMEWORK_VERSION=4.5.1 PHPUNIT_TEST=1
- php: 7.3
env: DB=MYSQL FRAMEWORK_VERSION=4.x-dev PHPUNIT_TEST=1 PHPCS_TEST=1

before_script:
- phpenv rehash
- phpenv config-rm xdebug.ini

- composer validate
- composer require --no-update silverstripe/framework:"$FRAMEWORK_VERSION"
- if [[ $SYMFONY_VERSION ]]; then composer require --no-update symfony/event-dispatcher:$SYMFONY_VERSION; fi
- composer install --no-interaction --no-progress --no-suggest --optimize-autoloader --verbose --profile

script:
- if [[ $PHPUNIT_TEST ]]; then vendor/bin/phpunit; fi
- if [[ $PHPUNIT_COVERAGE_TEST ]]; then phpdbg -qrr vendor/bin/phpunit --coverage-clover=coverage.xml; fi
- if [[ $PHPCS_TEST ]]; then vendor/bin/phpcs src/ tests/; fi

after_success:
- if [[ $PHPUNIT_COVERAGE_TEST ]]; then bash <(curl -s https://codecov.io/bash) -f coverage.xml -F php; fi
import:
- silverstripe/silverstripe-travis-shared:config/provision/standard-jobs-fixed.yml
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
],
"license": "BSD-3-Clause",
"require": {
"silverstripe/framework": "^4.5.1",
"silverstripe/framework": "^4.10",
"symfony/event-dispatcher": "^4.4 || ^5",
"psr/event-dispatcher": "^1",
"php": "^7.2"
"php": "^7.3 || ^8.0"
},
"require-dev": {
"phpunit/phpunit": "^5.7",
"phpunit/phpunit": "^9.5",
"squizlabs/php_codesniffer": "^3.0"
},
"autoload": {
Expand Down
25 changes: 14 additions & 11 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
<phpunit bootstrap="vendor/silverstripe/framework/tests/bootstrap.php" colors="true">
<testsuite name="silverstripe-module/skeleton">
<directory>tests/</directory>
</testsuite>
<filter>
<whitelist addUncoveredFilesFromWhitelist="true">
<?xml version="1.0"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/silverstripe/framework/tests/bootstrap.php" colors="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage includeUncoveredFiles="true">
<include>
<directory suffix=".php">src/</directory>
<exclude>
<directory suffix=".php">tests/</directory>
</exclude>
</whitelist>
</filter>
</include>
<exclude>
<directory suffix=".php">tests/</directory>
</exclude>
</coverage>
<testsuites>
<testsuite name="Default">
<directory>tests/</directory>
</testsuite>
</testsuites>
</phpunit>

0 comments on commit 15aff1b

Please sign in to comment.