1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* This file is part of the tarantool/client package. |
5
|
|
|
* |
6
|
|
|
* (c) Eugene Leonovich <[email protected]> |
7
|
|
|
* |
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
9
|
|
|
* file that was distributed with this source code. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
declare(strict_types=1); |
13
|
|
|
|
14
|
|
|
namespace Tarantool\Client\Tests; |
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* Compatibility layer for legacy PHPUnit versions. |
18
|
|
|
*/ |
19
|
|
|
trait PhpUnitCompat |
20
|
|
|
{ |
21
|
|
|
/** |
22
|
|
|
* TestCase::expectExceptionMessageRegExp() is deprecated since PHPUnit 8.4. |
23
|
|
|
*/ |
24
|
|
|
public function expectExceptionMessageMatches(string $regularExpression) : void |
|
|
|
|
25
|
|
|
{ |
26
|
|
|
is_callable('parent::expectExceptionMessageMatches') |
27
|
|
|
? parent::expectExceptionMessageMatches(...func_get_args()) |
28
|
|
|
: parent::expectExceptionMessageRegExp(...func_get_args()); |
|
|
|
|
29
|
|
|
} |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* Assert::assertEquals()'s $delta, $maxDepth, $canonicalize parameters are deprecated since PHPUnit 8.0. |
33
|
|
|
*/ |
34
|
|
|
public static function assertEqualsCanonicalizing($expected, $actual, string $message = '') : void |
35
|
|
|
{ |
36
|
|
|
is_callable('parent::assertEqualsCanonicalizing') |
37
|
|
|
? parent::assertEqualsCanonicalizing($expected, $actual, $message) |
38
|
|
|
: parent::assertEquals($expected, $actual, $message, 0.0, 10, true); |
|
|
|
|
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* Assert::assertRegExp() is deprecated since PHPUnit 9.1. |
43
|
|
|
*/ |
44
|
|
|
public static function assertMatchesRegularExpression(string $pattern, string $string, string $message = '') : void |
|
|
|
|
45
|
|
|
{ |
46
|
|
|
is_callable('parent::assertMatchesRegularExpression') |
47
|
|
|
? parent::assertMatchesRegularExpression(...func_get_args()) |
48
|
|
|
: parent::assertRegExp(...func_get_args()); |
|
|
|
|
49
|
|
|
} |
50
|
|
|
} |
51
|
|
|
|
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.