Skip to content

Commit ebf49b1

Browse files
authored
Merge pull request #20 from sergeyz/master
- Add Travis build matrix - Bump minimum PHP versions to >=5.6 (includes support for PHP 7.1) - Bump minimum PHPUnit versions to >=4.7
2 parents c54313d + 6a2bec8 commit ebf49b1

File tree

5 files changed

+72
-4
lines changed

5 files changed

+72
-4
lines changed

.travis.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
language: php
2+
3+
sudo: false
4+
5+
php:
6+
- 5.6
7+
- 7.0
8+
- 7.1
9+
- nightly
10+
- hhvm
11+
12+
env:
13+
- PHPUNIT=4.7.* # EOL August 7, 2016
14+
- PHPUNIT=4.8.* # EOL August 7, 2016
15+
- PHPUNIT=5.0.* # EOL February 3, 2017
16+
- PHPUNIT=5.1.* # EOL February 3, 2017
17+
- PHPUNIT=5.2.* # EOL February 2, 2018
18+
- PHPUNIT=5.3.* # EOL February 2, 2018
19+
- PHPUNIT=5.4.* # EOL February 2, 2018
20+
- PHPUNIT=5.5.* # EOL February 2, 2018
21+
- PHPUNIT=5.6.* # EOL February 2, 2018
22+
- PHPUNIT=5.7.* # EOL February 2, 2018
23+
- PHPUNIT=^6.0 # EOL February 2, 2018
24+
25+
matrix:
26+
exclude:
27+
- php: 5.6
28+
env: PHPUNIT=^6.0
29+
- php: hhvm
30+
env: PHPUNIT=^6.0
31+
32+
cache:
33+
directories:
34+
- $HOME/.composer
35+
36+
before_script:
37+
- phpenv config-rm xdebug.ini || true
38+
- composer self-update
39+
- composer config minimum-stability dev
40+
- composer require phpunit/phpunit:${PHPUNIT}
41+
42+
script:
43+
- ./vendor/bin/phpunit -c phpunit.xml.example --testsuite tests

composer.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,8 @@
1212
}
1313
],
1414
"require": {
15-
"php": ">=5.3.0"
16-
},
17-
"require-dev": {
18-
"phpunit/phpunit": "3.7.*|~4.0"
15+
"php": ">=5.6",
16+
"phpunit/phpunit": ">=4.7"
1917
},
2018
"autoload": {
2119
"psr-0": {

phpunit.xml.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
<testsuite name="Project Test Suite">
1818
<directory>src/*/*/*/Tests</directory>
1919
</testsuite>
20+
<testsuite name="tests">
21+
<directory>tests</directory>
22+
</testsuite>
2023
</testsuites>
2124

2225
<listeners>

src/JohnKary/PHPUnit/Listener/SpeedTrapListener.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,21 @@ public function addError(\PHPUnit_Framework_Test $test, \Exception $e, $time)
6161
{
6262
}
6363

64+
/**
65+
* A warning occurred.
66+
*
67+
* @param \PHPUnit_Framework_Test $test
68+
* @param \PHPUnit_Framework_Warning $e
69+
* @param float $time
70+
*
71+
* @since Method available since Release 6.0.0
72+
* @todo Uncomment in time for PHPUnit 6.0.0
73+
* @see https://github.com/sebastianbergmann/phpunit/pull/1840#issuecomment-162535997
74+
*/
75+
public function addWarning(\PHPUnit_Framework_Test $test, \PHPUnit_Framework_Warning $e, $time)
76+
{
77+
}
78+
6479
/**
6580
* A failure occurred.
6681
*

tests/SlowTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
class SlowTest extends \PHPUnit_Framework_TestCase
4+
{
5+
public function testListener()
6+
{
7+
sleep(1);
8+
}
9+
}

0 commit comments

Comments
 (0)