From 1117ec43a34102542649044db929ca04cc445f06 Mon Sep 17 00:00:00 2001 From: Simon Frings Date: Mon, 10 Aug 2020 11:25:44 +0200 Subject: [PATCH 1/3] Run tests on PHPUnit 9 and minor clean up --- .travis.yml | 27 ++++++++++++--------------- composer.json | 2 +- phpunit.xml.dist | 9 +++------ tests/GraphVizTest.php | 5 ++++- 4 files changed, 20 insertions(+), 23 deletions(-) diff --git a/.travis.yml b/.travis.yml index 14eeac7..8520936 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,26 +1,23 @@ language: php -php: -# - 5.3 # requires old distro, see below - - 5.4 - - 5.5 - - 5.6 - - 7.0 - - 7.1 - - 7.2 - - hhvm # ignore errors, see below - # lock distro so future defaults will not break the build dist: trusty -matrix: +jobs: include: - php: 5.3 dist: precise + - php: 5.4 + - php: 5.5 + - php: 5.6 + - php: 7.0 + - php: 7.1 + - php: 7.2 + - php: 7.3 + - php: 7.4 + - php: hhvm-3.18 allow_failures: - - php: hhvm - -sudo: false + - php: hhvm-3.18 addons: apt: @@ -28,7 +25,7 @@ addons: - graphviz install: - - composer install --no-interaction + - composer install script: - vendor/bin/phpunit --coverage-text diff --git a/composer.json b/composer.json index a096aa4..4d8aea6 100644 --- a/composer.json +++ b/composer.json @@ -13,6 +13,6 @@ "graphp/graph": "dev-master#81eef65 as 1.0.0" }, "require-dev": { - "phpunit/phpunit": "^6.4 || ^5.7 || ^4.8.35" + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35" } } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 7d3929a..4a1a66e 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,11 +1,8 @@ - + cacheResult="false"> ./tests/ @@ -16,4 +13,4 @@ ./src - \ No newline at end of file + diff --git a/tests/GraphVizTest.php b/tests/GraphVizTest.php index ab2c215..57678de 100644 --- a/tests/GraphVizTest.php +++ b/tests/GraphVizTest.php @@ -8,7 +8,10 @@ class GraphVizTest extends TestCase { private $graphViz; - public function setUp() + /** + * @before + */ + public function setUpGraphViz() { $this->graphViz = new GraphViz(); } From 86cf39c5073db462b5a86235907395d6e9b15c17 Mon Sep 17 00:00:00 2001 From: Simon Frings Date: Mon, 10 Aug 2020 11:25:44 +0200 Subject: [PATCH 2/3] Update PHPUnit configuration schema for PHPUnit 9.3 --- .travis.yml | 3 ++- phpunit.xml.dist => phpunit-legacy.xml | 8 +++++--- phpunit.xml | 19 +++++++++++++++++++ 3 files changed, 26 insertions(+), 4 deletions(-) rename phpunit.xml.dist => phpunit-legacy.xml (51%) create mode 100644 phpunit.xml diff --git a/.travis.yml b/.travis.yml index 8520936..11c9492 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,4 +28,5 @@ install: - composer install script: - - vendor/bin/phpunit --coverage-text + - if [[ "$TRAVIS_PHP_VERSION" > "7.2" ]]; then vendor/bin/phpunit --coverage-text; fi + - if [[ "$TRAVIS_PHP_VERSION" < "7.3" ]]; then vendor/bin/phpunit --coverage-text -c phpunit-legacy.xml; fi diff --git a/phpunit.xml.dist b/phpunit-legacy.xml similarity index 51% rename from phpunit.xml.dist rename to phpunit-legacy.xml index 4a1a66e..fac174b 100644 --- a/phpunit.xml.dist +++ b/phpunit-legacy.xml @@ -1,8 +1,10 @@ - + + ./tests/ diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 0000000..7e8a89a --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,19 @@ + + + + + + + ./tests/ + + + + + ./src + + + From 4e44cf1555116d4b052b6498911a344054403c91 Mon Sep 17 00:00:00 2001 From: Simon Frings Date: Mon, 10 Aug 2020 11:49:50 +0200 Subject: [PATCH 3/3] Add .gitattributes to exclude dev files from exports --- .gitattributes | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..047ced0 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,7 @@ +/.gitattributes export-ignore +/.gitignore export-ignore +/.travis.yml export-ignore +/examples export-ignore +/phpunit.xml export-ignore +/phpunit-legacy.xml export-ignore +/tests export-ignore