File tree Expand file tree Collapse file tree 3 files changed +52
-40
lines changed Expand file tree Collapse file tree 3 files changed +52
-40
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ use PHPUnit \Framework \TestCase as BaseTestCase ;
4+
5+ class Php56TestCase extends BaseTestCase
6+ {
7+ protected function setUp ()
8+ {
9+ if (method_exists ($ this , '_setUp ' )) {
10+ $ this ->_setUp ();
11+ }
12+ }
13+
14+ protected function tearDown ()
15+ {
16+ if (method_exists ($ this , '_tearDown ' )) {
17+ $ this ->_tearDown ();
18+ }
19+ }
20+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ use PHPUnit \Framework \TestCase as BaseTestCase ;
4+
5+ class Php71TestCase extends BaseTestCase
6+ {
7+ protected function setUp (): void
8+ {
9+ if (method_exists ($ this , '_setUp ' )) {
10+ $ this ->_setUp ();
11+ }
12+ }
13+
14+ protected function tearDown (): void
15+ {
16+ if (method_exists ($ this , '_tearDown ' )) {
17+ $ this ->_tearDown ();
18+ }
19+ }
20+
21+ public static function assertRegExp (string $ pattern , string $ string , string $ message = '' ): void
22+ {
23+ self ::assertMatchesRegularExpression ($ pattern , $ string , $ message );
24+ }
25+
26+ public static function assertNotRegExp (string $ pattern , string $ string , string $ message = '' ): void
27+ {
28+ self ::assertDoesNotMatchRegularExpression ($ pattern , $ string , $ message );
29+ }
30+ }
Original file line number Diff line number Diff line change 11<?php
22
3- use PHPUnit \Framework \TestCase as BaseTestCase ;
4-
53if (version_compare (PHP_VERSION , '7.1.0 ' , '>= ' )) {
6- class TestCase extends BaseTestCase
4+ class TestCase extends Php71TestCase
75 {
8- protected function setUp (): void
9- {
10- if (method_exists ($ this , '_setUp ' )) {
11- $ this ->_setUp ();
12- }
13- }
14-
15- protected function tearDown (): void
16- {
17- if (method_exists ($ this , '_tearDown ' )) {
18- $ this ->_tearDown ();
19- }
20- }
21-
22- public static function assertRegExp (string $ pattern , string $ string , string $ message = '' ): void
23- {
24- self ::assertMatchesRegularExpression ($ pattern , $ string , $ message );
25- }
26-
27- public static function assertNotRegExp (string $ pattern , string $ string , string $ message = '' ): void
28- {
29- self ::assertDoesNotMatchRegularExpression ($ pattern , $ string , $ message );
30- }
316 }
327} else {
33- class TestCase extends BaseTestCase
8+ class TestCase extends Php56TestCase
349 {
35- protected function setUp ()
36- {
37- if (method_exists ($ this , '_setUp ' )) {
38- $ this ->_setUp ();
39- }
40- }
41-
42- protected function tearDown ()
43- {
44- if (method_exists ($ this , '_tearDown ' )) {
45- $ this ->_tearDown ();
46- }
47- }
4810 }
4911}
You can’t perform that action at this time.
0 commit comments