diff --git a/.travis.yml b/.travis.yml index 57ab098..04f51ad 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,17 +1,27 @@ language: php php: - - 5.3 +# - 5.3 # requires old distro, see below - 5.4 - 5.5 - 5.6 - 7 - - hhvm + - hhvm # ignore errors, see below + +# lock distro so new future defaults will not break the build +dist: trusty + +matrix: + include: + - php: 5.3 + dist: precise + allow_failures: + - php: hhvm sudo: false install: - - composer install --prefer-source --no-interaction + - composer install --no-interaction script: - - phpunit --coverage-text + - vendor/bin/phpunit --coverage-text diff --git a/README.md b/README.md index d2adbc3..776c866 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,21 @@ $ composer require react/datagram:^1.1.1 See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades. +## Tests + +To run the test suite, you first need to clone this repo and then install all +dependencies [through Composer](http://getcomposer.org): + +```bash +$ composer install +``` + +To run the test suite, go to the project root and run: + +```bash +$ php vendor/bin/phpunit +``` + ## License MIT diff --git a/composer.json b/composer.json index d781987..b2b82fd 100644 --- a/composer.json +++ b/composer.json @@ -21,6 +21,7 @@ "react/promise": "~2.1|~1.2" }, "require-dev": { - "clue/block-react": "~1.0" + "clue/block-react": "~1.0", + "phpunit/phpunit": "^5.0 || ^4.8" } } diff --git a/tests/FactoryTest.php b/tests/FactoryTest.php index fa87b8d..0cadc9e 100644 --- a/tests/FactoryTest.php +++ b/tests/FactoryTest.php @@ -162,7 +162,7 @@ public function testCancelCreateClientWithCancellableHostnameResolver() public function testCancelCreateClientWithUncancellableHostnameResolver() { - $promise = $this->getMock('React\Promise\PromiseInterface'); + $promise = $this->getMockBuilder('React\Promise\PromiseInterface')->getMock(); $this->resolver->expects($this->once())->method('resolve')->with('example.com')->willReturn($promise); $promise = $this->factory->createClient('example.com:0'); diff --git a/tests/bootstrap.php b/tests/bootstrap.php index a94af33..e77ec46 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -26,7 +26,7 @@ protected function expectCallableNever() protected function createCallableMock() { - return $this->getMock('CallableStub'); + return $this->getMockBuilder('CallableStub')->getMock(); } protected function createResolverMock()