diff --git a/.travis.yml b/.travis.yml index 16362f20..30be35b8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,24 @@ language: php php: - - 5.3 +# - 5.3 # requires old distro, see below - 5.4 - 5.5 - 5.6 - - 7 - - hhvm + - 7.0 + - 7.1 + - 7.2 + - hhvm # ignore errors, see below + +# lock distro so future defaults will not break the build +dist: trusty + +matrix: + include: + - php: 5.3 + dist: precise + allow_failures: + - php: hhvm sudo: false @@ -14,4 +26,4 @@ install: - composer install --no-interaction script: - - php vendor/bin/phpunit --coverage-text + - vendor/bin/phpunit --coverage-text diff --git a/README.md b/README.md index 03ece0c0..31f41e6b 100644 --- a/README.md +++ b/README.md @@ -96,16 +96,25 @@ The recommended way to install this library is [through composer](http://getcomp } ``` +This project aims to run on any platform and thus does not require any PHP +extensions and supports running on legacy PHP 5.3 through current PHP 7+ and +HHVM. +It's *highly recommended to use PHP 7+* for this project. + You may also want to install some of the [additional components](#components). A list of all official components can be found in the [graphp project](https://github.com/graphp). ## Tests This library uses PHPUnit for its extensive test suite. -You can either use a global installation or rely on the one composer installs -when you first run `$ composer install`. -This sets up the developer environment, so that you -can now run it from the project root directory: +To run the test suite, you first need to clone this repo and then install all +dependencies [through Composer](https://getcomposer.org): + +```bash +$ composer install +``` + +To run the test suite, go to the project root and run: ```bash $ php vendor/bin/phpunit diff --git a/_config.yml b/_config.yml deleted file mode 100644 index c4192631..00000000 --- a/_config.yml +++ /dev/null @@ -1 +0,0 @@ -theme: jekyll-theme-cayman \ No newline at end of file diff --git a/composer.json b/composer.json index 61564dd8..f316bb91 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ "php": "^7.0 || ^5.3" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "phpunit/phpunit": "^6.4 || ^5.7 || ^4.8.35" }, "suggest": { "graphp/graphviz": "GraphViz graph drawing / DOT output", diff --git a/tests/GraphTest.php b/tests/GraphTest.php index 45731b13..e72239c8 100644 --- a/tests/GraphTest.php +++ b/tests/GraphTest.php @@ -203,7 +203,7 @@ public function testCreateVerticesNone() /** * expect to fail for invalid number of vertices * @expectedException InvalidArgumentException - * @dataProvider testCreateVerticesFailProvider + * @dataProvider createVerticesFailProvider */ public function testCreateVerticesFail($number) { @@ -211,7 +211,7 @@ public function testCreateVerticesFail($number) $graph->createVertices($number); } - public static function testCreateVerticesFailProvider() + public static function createVerticesFailProvider() { return array( array(-1), diff --git a/tests/TestCase.php b/tests/TestCase.php index 7653cb20..7d739787 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -6,10 +6,9 @@ use Fhaculty\Graph\Edge\Base as Edge; use Fhaculty\Graph\Graph; use Fhaculty\Graph\Vertex; -use Fhaculty\Graph\Set\Vertices; -use PHPUnit_Framework_TestCase; +use PHPUnit\Framework\TestCase as BaseTestCase; -class TestCase extends PHPUnit_Framework_TestCase +class TestCase extends BaseTestCase { protected function assertGraphEquals(Graph $expected, Graph $actual) { @@ -29,11 +28,8 @@ protected function assertGraphEquals(Graph $expected, Graph $actual) // do not use assertVertexEquals() in order to not increase assertion counter foreach ($expected->getVertices()->getMap() as $vid => $vertex) { - try { - $other = $actual->getVertex($vid); - } catch (Exception $e) { - $this->fail(); - } + $other = $actual->getVertex($vid); + if ($this->getVertexDump($vertex) !== $this->getVertexDump($vertex)) { $this->fail(); }