Skip to content

Commit 20246a3

Browse files
authored
Merge pull request #175 from SimonFrings/tests-1.x
Run tests on PHPUnit 9 and PHP 7.4, clean up test suite and add .gitattributes to exclude dev files from export (promise-1.x)
2 parents 0bb8d4f + 5b8f273 commit 20246a3

28 files changed

+144
-68
lines changed

.gitattributes

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/.gitattributes export-ignore
2+
/.gitignore export-ignore
3+
/.travis.yml export-ignore
4+
/examples/ export-ignore
5+
/phpunit.xml.dist export-ignore
6+
/tests/ export-ignore

.travis.yml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
11
language: php
22

3-
php:
4-
- 5.3
5-
- 5.4
6-
- 5.5
7-
- 5.6
8-
- 7.0
9-
- hhvm
3+
# lock distro so new future defaults will not break the build
4+
dist: trusty
105

11-
before_install:
12-
- composer self-update
6+
jobs:
7+
include:
8+
- php: 5.3
9+
dist: precise
10+
- php: 5.4
11+
- php: 5.5
12+
- php: 5.6
13+
- php: 7.0
14+
- php: 7.1
15+
- php: 7.2
16+
- php: 7.3
17+
- php: 7.4
18+
- php: hhvm-3.18
19+
allow_failures:
20+
- php: hhvm-3.18
1321

1422
install:
15-
- composer install --prefer-source
23+
- composer install
1624

1725
script:
18-
- phpunit -v --coverage-text
26+
- vendor/bin/phpunit --coverage-text

composer.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,20 @@
88
"require": {
99
"php": ">=5.3.3"
1010
},
11+
"require-dev": {
12+
"phpunit/phpunit": "^9.0 || ^5.7 || ^4.8.35"
13+
},
1114
"autoload": {
12-
"psr-0": {
13-
"React\\Promise": "src/"
15+
"psr-4": {
16+
"React\\Promise\\": "src/React/Promise/"
1417
},
1518
"files": ["src/React/Promise/functions_include.php"]
1619
},
20+
"autoload-dev": {
21+
"psr-4": {
22+
"React\\Tests\\Promise\\": "tests/React/Promise/"
23+
}
24+
},
1725
"extra": {
1826
"branch-alias": {
1927
"dev-master": "1.1-dev"

phpunit.xml.dist

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

3-
<phpunit backupGlobals="false"
4-
backupStaticAttributes="false"
5-
colors="true"
6-
convertErrorsToExceptions="true"
7-
convertNoticesToExceptions="false"
8-
convertWarningsToExceptions="true"
9-
processIsolation="false"
10-
stopOnFailure="false"
11-
syntaxCheck="false"
12-
bootstrap="tests/bootstrap.php"
13-
>
3+
<phpunit bootstrap="vendor/autoload.php" colors="true">
144
<testsuites>
155
<testsuite name="Promise Test Suite">
166
<directory>./tests/React/Promise/</directory>

tests/React/Promise/DeferredProgressTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?php
22

3-
namespace React\Promise;
3+
namespace React\Tests\Promise;
4+
5+
use React\Promise\Deferred;
46

57
/**
68
* @group Deferred

tests/React/Promise/DeferredPromiseTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?php
22

3-
namespace React\Promise;
3+
namespace React\Tests\Promise;
4+
5+
use React\Promise\DeferredPromise;
46

57
/**
68
* @group Promise

tests/React/Promise/DeferredRejectTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
<?php
22

3-
namespace React\Promise;
3+
namespace React\Tests\Promise;
4+
5+
use React\Promise\Deferred;
6+
use React\Promise\FulfilledPromise;
7+
use React\Promise\RejectedPromise;
48

59
/**
610
* @group Deferred

tests/React/Promise/DeferredResolveTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
<?php
22

3-
namespace React\Promise;
3+
namespace React\Tests\Promise;
4+
5+
use React\Promise\Deferred;
6+
use React\Promise\FulfilledPromise;
7+
use React\Promise\RejectedPromise;
8+
use React\Promise\When;
49

510
/**
611
* @group Deferred

tests/React/Promise/DeferredResolverTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?php
22

3-
namespace React\Promise;
3+
namespace React\Tests\Promise;
4+
5+
use React\Promise\DeferredResolver;
46

57
/**
68
* @group Resolver

tests/React/Promise/DeferredTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?php
22

3-
namespace React\Promise;
3+
namespace React\Tests\Promise;
4+
5+
use React\Promise\Deferred;
46

57
/**
68
* @group Deferred
@@ -204,10 +206,10 @@ public function shouldInvokeCancellationHandleWhenCancellingAllDerived()
204206

205207
/**
206208
* @test
207-
* @expectedException InvalidArgumentException
208209
*/
209210
public function shouldThrowIfCancellerIsNotACallable()
210211
{
212+
$this->setExpectedException('InvalidArgumentException');
211213
new Deferred(false);
212214
}
213215
}

0 commit comments

Comments
 (0)