Skip to content

Commit 77a2c35

Browse files
committed
Upgrade to PHPUnit-6
As PHPUnit-6 doesn't support PHP-5 I, have to drop that support here as well. Therefore this commit requires a major release. Older PHPUnit versions cannot be supported any more. Refer to version 1 if you need support for PHP-5, PHPUnit-4 or PHPUnit-5. See also: #14
1 parent ed675d7 commit 77a2c35

File tree

6 files changed

+16
-51
lines changed

6 files changed

+16
-51
lines changed

.travis.yml

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -8,55 +8,18 @@ cache:
88

99
env:
1010
- PHPUNIT_VERSION=dev-master
11-
- PHPUNIT_VERSION=~5.7.0
12-
- PHPUNIT_VERSION=~5.6.0
13-
- PHPUNIT_VERSION=~5.5.0
14-
- PHPUNIT_VERSION=~5.4.0
15-
- PHPUNIT_VERSION=~5.3.0
16-
- PHPUNIT_VERSION=~5.2.0
17-
- PHPUNIT_VERSION=~5.1.0
18-
- PHPUNIT_VERSION=~5.0.0
19-
- PHPUNIT_VERSION=~4.8.0
20-
- PHPUNIT_VERSION=~4.7.0
21-
- PHPUNIT_VERSION=~4.6.0
22-
- PHPUNIT_VERSION=~4.5.0
23-
- PHPUNIT_VERSION=~4.4.0
24-
- PHPUNIT_VERSION=~4.3.0
25-
- PHPUNIT_VERSION=~4.2.0
26-
- PHPUNIT_VERSION=~4.1.0
27-
- PHPUNIT_VERSION=~4.0.0
11+
- PHPUNIT_VERSION=~6.0.0
2812

2913
php:
3014
- 7.1
3115
- 7.0
32-
- 5.6
33-
- 5.5
3416
- hhvm
3517

3618
matrix:
3719
fast_finish: true
3820
allow_failures:
3921
- php: hhvm
4022
- env: PHPUNIT_VERSION=dev-master
41-
exclude:
42-
- env: PHPUNIT_VERSION=~5.0.0
43-
php: 5.5
44-
- env: PHPUNIT_VERSION=~5.1.0
45-
php: 5.5
46-
- env: PHPUNIT_VERSION=~5.2.0
47-
php: 5.5
48-
- env: PHPUNIT_VERSION=~5.3.0
49-
php: 5.5
50-
- env: PHPUNIT_VERSION=~5.4.0
51-
php: 5.5
52-
- env: PHPUNIT_VERSION=~5.5.0
53-
php: 5.5
54-
- env: PHPUNIT_VERSION=~5.6.0
55-
php: 5.5
56-
- env: PHPUNIT_VERSION=~5.7.0
57-
php: 5.5
58-
- env: PHPUNIT_VERSION=dev-master
59-
php: 5.5
6023

6124
install:
6225
- composer require phpunit/phpunit:${PHPUNIT_VERSION}

classes/MockDisabler.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
namespace phpmock\phpunit;
44

55
use phpmock\Deactivatable;
6+
use PHPUnit\Framework\BaseTestListener;
7+
use PHPUnit\Framework\Test;
68

79
/**
810
* Test listener for PHPUnit integration.
@@ -14,7 +16,7 @@
1416
* @license http://www.wtfpl.net/txt/copying/ WTFPL
1517
* @internal
1618
*/
17-
class MockDisabler extends \PHPUnit_Framework_BaseTestListener
19+
class MockDisabler extends BaseTestListener
1820
{
1921

2022
/**
@@ -35,12 +37,12 @@ public function __construct(Deactivatable $deactivatable)
3537
/**
3638
* Disables the function mocks.
3739
*
38-
* @param \PHPUnit_Framework_Test $test The test.
39-
* @param int $time The test duration.
40+
* @param Test $test The test.
41+
* @param int $time The test duration.
4042
*
4143
* @see Mock::disable()
4244
*/
43-
public function endTest(\PHPUnit_Framework_Test $test, $time)
45+
public function endTest(Test $test, $time)
4446
{
4547
parent::endTest($test, $time);
4648

composer.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,11 @@
1717
"psr-4": {"phpmock\\phpunit\\": "classes/"}
1818
},
1919
"require": {
20-
"php": ">=5.5",
21-
"phpunit/phpunit": "^4.0.0 || ^5.0.0",
22-
"php-mock/php-mock-integration": "^1"
20+
"php": ">=7",
21+
"phpunit/phpunit": "^6",
22+
"php-mock/php-mock-integration": "^2"
2323
},
2424
"archive": {
2525
"exclude": ["/tests"]
26-
},
27-
"conflict": {
28-
"phpunit/phpunit-mock-objects": "3.2.0"
2926
}
3027
}

tests/MockDisablerTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace phpmock\phpunit;
44

55
use phpmock\Mock;
6+
use PHPUnit\Framework\TestCase;
67

78
/**
89
* Tests MockDisabler.
@@ -12,7 +13,7 @@
1213
* @license http://www.wtfpl.net/txt/copying/ WTFPL
1314
* @see MockDisabler
1415
*/
15-
class MockDisablerTest extends \PHPUnit_Framework_TestCase
16+
class MockDisablerTest extends TestCase
1617
{
1718

1819
/**

tests/MockObjectProxyTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace phpmock\phpunit;
44

55
use \PHPUnit_Framework_MockObject_Builder_InvocationMocker as InvocationMocker;
6+
use PHPUnit\Framework\TestCase;
67
use phpmock\integration\MockDelegateFunctionBuilder;
78

89
/**
@@ -14,7 +15,7 @@
1415
* @see MockObjectProxy
1516
* @requires PHPUnit 4.5.0
1617
*/
17-
class MockObjectProxyTest extends \PHPUnit_Framework_TestCase
18+
class MockObjectProxyTest extends TestCase
1819
{
1920

2021
/**

tests/PHPMockTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace phpmock\phpunit;
44

55
use phpmock\AbstractMockTest;
6+
use PHPUnit\Framework\ExpectationFailedException;
67

78
/**
89
* Tests PHPMock.
@@ -58,7 +59,7 @@ public function testFunctionMockFailsExpectation()
5859

5960
$time->__phpunit_verify();
6061
$this->fail("Expectation should fail");
61-
} catch (\PHPUnit_Framework_ExpectationFailedException $e) {
62+
} catch (ExpectationFailedException $e) {
6263
time(); // satisfy the expectation
6364
}
6465
}

0 commit comments

Comments
 (0)