Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run test on PHPUnit 9, run tests on PHP 7.4, simplify test matrix and clean up test suite #22

Merged
merged 3 commits into from
Jul 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 11 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
language: php

php:
# - 5.3 # requires old distro, see below
- 5.4
- 5.5
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3
- hhvm # ignore errors, see below

# lock distro so new 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
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@
"react/event-loop": "^1.0 || ^0.5 || ^0.4 || ^0.3",
"react/promise-timer": "^1.0",
"clue/block-react": "^1.0",
"phpunit/phpunit": "^7.0 || ^6.4 || ^5.7 || ^4.8.35"
"phpunit/phpunit": "^9.0 || ^5.7 || ^4.8.35"
}
}
7 changes: 1 addition & 6 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
>
<phpunit bootstrap="vendor/autoload.php" colors="true">
<testsuites>
<testsuite name="PromiseStream Test Suite">
<directory>./tests/</directory>
Expand Down
10 changes: 0 additions & 10 deletions tests/CallableStub.php

This file was deleted.

8 changes: 7 additions & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,13 @@ protected function expectCallableNever()
*/
protected function createCallableMock()
{
return $this->getMockBuilder('React\Tests\Promise\Stream\CallableStub')->getMock();
if (method_exists('PHPUnit\Framework\MockObject\MockBuilder', 'addMethods')) {
// PHPUnit 9+
return $this->getMockBuilder('stdClass')->addMethods(array('__invoke'))->getMock();
} else {
// legacy PHPUnit 4 - PHPUnit 9
return $this->getMockBuilder('stdClass')->setMethods(array('__invoke'))->getMock();
}
}

protected function expectPromiseResolve($promise)
Expand Down
5 changes: 4 additions & 1 deletion tests/UnwrapReadableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ class UnwrapReadableTest extends TestCase
{
private $loop;

public function setUp()
/**
* @before
*/
public function setUpLoop()
{
$this->loop = Factory::create();
}
Expand Down
5 changes: 4 additions & 1 deletion tests/UnwrapWritableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ class UnwrapWritableTest extends TestCase
{
private $loop;

public function setUp()
/**
* @before
*/
public function setUpLoop()
{
$this->loop = Factory::create();
}
Expand Down