Skip to content

Commit

Permalink
Merge pull request #255 from KnpLabs/update-phpunit
Browse files Browse the repository at this point in the history
Updating to use phpunit-bridge and updating travis config
  • Loading branch information
weaverryan authored Dec 30, 2019
2 parents 7c5fa65 + 2b6d8f8 commit 7171856
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 39 deletions.
50 changes: 28 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,38 @@
language: php

sudo: false
cache:
directories:
- $HOME/.composer/cache
directories:
- $HOME/.composer/cache/files
- $HOME/symfony-bridge/.phpunit

php:
- 7.1
- 7.2
- 7.3
env:
global:
- PHPUNIT_FLAGS="-v"
- SYMFONY_PHPUNIT_DIR="$HOME/symfony-bridge/.phpunit"
- SYMFONY_REQUIRE='>=2.8'

matrix:
include:
- php: 7.3
env: SYMFONY_VERSION="5.0.*@dev"
- php: 7.1
env: SYMFONY_VERSION="4.3.*@dev"
- php: 7.3
env: SYMFONY_VERSION="3.4.*@dev"
- php: 7.2
env: DEPENDENCIES=beta
fast_finish: true
fast_finish: true
include:
- php: 7.1
- php: 7.2
- php: 7.3
env: deps=low

before_install:
- if [ "$DEPENDENCIES" = "beta" ]; then composer config minimum-stability beta; fi;
- if [ "$DEPENDENCIES" = "dev" ]; then composer config minimum-stability dev; fi;
- if [[ "$SYMFONY_VERSION" != "" ]]; then composer require --no-update symfony/symfony:${SYMFONY_VERSION}; fi
- phpenv config-rm xdebug.ini || true
- composer global require --no-progress --no-scripts --no-plugins symfony/flex dev-master

install: composer update --prefer-dist
install:
- |
if [[ $deps = low ]]; then
export SYMFONY_DEPRECATIONS_HELPER=weak
composer update --prefer-dist --prefer-lowest --prefer-stable
else
composer update --prefer-dist
fi
- ./vendor/bin/simple-phpunit install

script:
- vendor/bin/phpunit
- composer validate --strict --no-check-lock
- ./vendor/bin/simple-phpunit $PHPUNIT_FLAGS
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"homepage": "http://github.com/KnpLabs/KnpSnappyBundle/contributors"
}
],

"minimum-stability": "dev",
"require": {
"php": ">=7.1",
"symfony/framework-bundle": "^3.4|^4.3|^5.0",
Expand All @@ -35,9 +35,9 @@
},
"require-dev": {
"doctrine/annotations": "~1.0",
"phpunit/phpunit": "~7.4",
"symfony/asset": "^3.4|^4.3|^5.0",
"symfony/finder": "^3.4|^4.3|^5.0",
"symfony/phpunit-bridge": "^4.3|^5.0",
"symfony/security-csrf": "^3.4|^4.3|^5.0",
"symfony/templating": "^3.4|^4.3|^5.0",
"symfony/validator": "^3.4|^4.3|^5.0",
Expand Down
40 changes: 25 additions & 15 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- http://www.phpunit.de/manual/current/en/appendixes.configuration.html -->

<phpunit
backupGlobals = "false"
backupStaticAttributes = "false"
colors = "true"
convertErrorsToExceptions = "true"
convertNoticesToExceptions = "true"
convertWarningsToExceptions = "true"
processIsolation = "false"
stopOnFailure = "false"
bootstrap = "vendor/autoload.php" >
<!-- http://phpunit.de/manual/4.1/en/appendixes.configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/6.3/phpunit.xsd"
backupGlobals="false"
bootstrap="vendor/autoload.php"
colors="true"
failOnRisky="true"
failOnWarning="true"
>
<php>
<server name="SYMFONY_PHPUNIT_VERSION" value="7.5" />
</php>

<testsuites>
<testsuite name="KnpSnappyBundle Test Suite">
<directory>./Tests</directory>
<testsuite name="Project Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
</phpunit>

<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory>.</directory>
<exclude>
<directory>tests</directory>
<directory>vendor</directory>
</exclude>
</whitelist>
</filter>
</phpunit>

0 comments on commit 7171856

Please sign in to comment.