Skip to content
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
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ matrix:
- php: 7.3
- php: 7.4
- php: hhvm-3.18
install: composer require phpunit/phpunit:^5 --dev --no-interaction # requires legacy phpunit
allow_failures:
- php: hhvm-3.18

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
"react/promise": "^3.0 || ^2.7.0 || ^1.2.1"
},
"require-dev": {
"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="Promise Timer Test Suite">
<directory>./tests/</directory>
Expand Down
10 changes: 0 additions & 10 deletions tests/CallableStub.php

This file was deleted.

13 changes: 11 additions & 2 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ class TestCase extends BaseTestCase
{
protected $loop;

public function setUp()
/**
* @before
*/
public function setUpLoop()
{
$this->loop = Factory::create();
}
Expand Down Expand Up @@ -41,7 +44,13 @@ protected function expectCallableNever()
*/
protected function createCallableMock()
{
return $this->getMockBuilder('React\Tests\Promise\Timer\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 expectPromiseRejected($promise)
Expand Down