diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..e9da46b --- /dev/null +++ b/.gitattributes @@ -0,0 +1,6 @@ +/.gitattributes export-ignore +/.gitignore export-ignore +/.travis.yml export-ignore +/phpunit.xml.dist export-ignore +/phpunit.xml.legacy export-ignore +/tests export-ignore diff --git a/.travis.yml b/.travis.yml index 30be35b..e2743c6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,29 +1,27 @@ 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 install: - - composer install --no-interaction + - 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.xml.legacy; fi diff --git a/composer.json b/composer.json index a8c7a0d..bf48b8f 100644 --- a/composer.json +++ b/composer.json @@ -16,9 +16,12 @@ "clue/graph": "~0.9.0|~0.8.0" }, "require-dev": { - "phpunit/phpunit": "^6.4 || ^5.7 || ^4.8.35" + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35" }, "autoload": { "psr-4": {"Graphp\\GraphML\\": "src/"} + }, + "autoload-dev": { + "psr-4": { "Graphp\\Tests\\GraphML\\": "tests/" } } } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 92a5b35..43c615b 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,19 +1,19 @@ - + + cacheResult="false"> ./tests/ - - - ./src - - - \ No newline at end of file + + + ./src/ + + + diff --git a/phpunit.xml.legacy b/phpunit.xml.legacy new file mode 100644 index 0000000..9491828 --- /dev/null +++ b/phpunit.xml.legacy @@ -0,0 +1,18 @@ + + + + + + + ./tests/ + + + + + ./src/ + + + diff --git a/tests/ExporterTest.php b/tests/ExporterTest.php index d8f3cd0..7017f41 100644 --- a/tests/ExporterTest.php +++ b/tests/ExporterTest.php @@ -1,5 +1,7 @@ exporter = new Exporter(); } @@ -17,7 +22,7 @@ public function testEmpty() $graph = new Graph(); $output = $this->exporter->getOutput($graph); - $xml = new SimpleXMLElement($output); + $xml = new \SimpleXMLElement($output); $this->assertEquals(1, count($xml)); $this->assertEquals(1, count($xml->graph)); @@ -33,7 +38,7 @@ public function testSimple() $v1->createEdge($v2); $output = $this->exporter->getOutput($graph); - $xml = new SimpleXMLElement($output); + $xml = new \SimpleXMLElement($output); $this->assertEquals(1, count($xml->graph->edge)); @@ -52,7 +57,7 @@ public function testSimpleDirected() $v1->createEdgeTo($v2); $output = $this->exporter->getOutput($graph); - $xml = new SimpleXMLElement($output); + $xml = new \SimpleXMLElement($output); $this->assertEquals(1, count($xml->graph->edge)); diff --git a/tests/FunctionalTest.php b/tests/FunctionalTest.php index 69ba05c..47d06f9 100644 --- a/tests/FunctionalTest.php +++ b/tests/FunctionalTest.php @@ -1,5 +1,7 @@ loader = new Loader(); } diff --git a/tests/bootstrap.php b/tests/TestCase.php similarity index 94% rename from tests/bootstrap.php rename to tests/TestCase.php index b211810..d9a3975 100644 --- a/tests/bootstrap.php +++ b/tests/TestCase.php @@ -1,14 +1,13 @@