This repository was archived by the owner on Jan 10, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +60
-5
lines changed Expand file tree Collapse file tree 5 files changed +60
-5
lines changed Original file line number Diff line number Diff line change 17
17
18
18
install :
19
19
- travis_retry composer self-update && composer --version
20
- - travis_retry composer global require "fxp/composer-asset-plugin:^1.2.0 "
20
+ - travis_retry composer global require "fxp/composer-asset-plugin:^1.3.1 "
21
21
- export PATH="$HOME/.composer/vendor/bin:$PATH"
22
22
- travis_retry composer install --prefer-dist --no-interaction
23
23
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ public function testSetupValue()
17
17
$ mapping ->setValue ($ value );
18
18
$ this ->assertSame ($ value , $ mapping ->getValue ($ owner ));
19
19
20
- $ this ->setExpectedException ('yii\base\InvalidParamException ' );
20
+ $ this ->expectException ('yii\base\InvalidParamException ' );
21
21
$ mapping ->setValue ('foo ' );
22
22
}
23
23
@@ -36,7 +36,7 @@ public function testSetupMultipleValue()
36
36
$ actualValue = $ mapping ->getValue ($ owner );
37
37
$ this ->assertTrue ($ actualValue instanceof \ArrayAccess);
38
38
39
- $ this ->setExpectedException ('yii\base\InvalidParamException ' );
39
+ $ this ->expectException ('yii\base\InvalidParamException ' );
40
40
$ mapping ->setValue ('foo ' );
41
41
}
42
42
Original file line number Diff line number Diff line change 8
8
/**
9
9
* Base class for the test cases.
10
10
*/
11
- class TestCase extends \PHPUnit_Framework_TestCase
11
+ class TestCase extends \PHPUnit \ Framework \TestCase
12
12
{
13
13
protected function setUp ()
14
14
{
Original file line number Diff line number Diff line change 12
12
require_once (__DIR__ . '/../vendor/yiisoft/yii2/Yii.php ' );
13
13
14
14
Yii::setAlias ('@yii2tech/tests/unit/embedded ' , __DIR__ );
15
- Yii::setAlias ('@yii2tech/embedded ' , dirname (__DIR__ ));
15
+ Yii::setAlias ('@yii2tech/embedded ' , dirname (__DIR__ ));
16
+
17
+ require_once (__DIR__ . '/compatibility.php ' );
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /*
3
+ * Ensures compatibility with PHPUnit < 6.x
4
+ */
5
+
6
+ namespace PHPUnit \Framework \Constraint {
7
+ if (!class_exists ('PHPUnit\Framework\Constraint\Constraint ' ) && class_exists ('PHPUnit_Framework_Constraint ' )) {
8
+ abstract class Constraint extends \PHPUnit_Framework_Constraint
9
+ {
10
+ }
11
+ }
12
+ }
13
+
14
+ namespace PHPUnit \Framework {
15
+ if (!class_exists ('PHPUnit\Framework\TestCase ' ) && class_exists ('PHPUnit_Framework_TestCase ' )) {
16
+ abstract class TestCase extends \PHPUnit_Framework_TestCase
17
+ {
18
+ /**
19
+ * @param string $exception
20
+ */
21
+ public function expectException ($ exception )
22
+ {
23
+ $ this ->setExpectedException ($ exception );
24
+ }
25
+
26
+ /**
27
+ * @param string $message
28
+ */
29
+ public function expectExceptionMessage ($ message )
30
+ {
31
+ $ parentClassMethods = get_class_methods ('PHPUnit_Framework_TestCase ' );
32
+ if (in_array ('expectExceptionMessage ' , $ parentClassMethods )) {
33
+ parent ::expectExceptionMessage ($ message );
34
+ return ;
35
+ }
36
+ $ this ->setExpectedException ($ this ->getExpectedException (), $ message );
37
+ }
38
+
39
+ /**
40
+ * @param string $messageRegExp
41
+ */
42
+ public function expectExceptionMessageRegExp ($ messageRegExp )
43
+ {
44
+ $ parentClassMethods = get_class_methods ('PHPUnit_Framework_TestCase ' );
45
+ if (in_array ('expectExceptionMessageRegExp ' , $ parentClassMethods )) {
46
+ parent ::expectExceptionMessageRegExp ($ messageRegExp );
47
+ return ;
48
+ }
49
+ $ this ->setExpectedExceptionRegExp ($ this ->getExpectedException (), $ messageRegExp );
50
+ }
51
+ }
52
+ }
53
+ }
You can’t perform that action at this time.
0 commit comments