1 | <?php |
||
8 | class UriPartTestCase extends \PHPUnit_Framework_TestCase |
||
9 | { |
||
10 | /** |
||
11 | * Asserts that the given expected string is the same as the string returned by an object instance's __toString |
||
12 | * magic method. |
||
13 | * |
||
14 | * @param string $expected The string expected to match |
||
15 | * @param UriPartInterface $test_instance An instance of the object whose __toString method is under test |
||
16 | */ |
||
17 | 89 | public static function assertSameAsToString($expected, UriPartInterface $test_instance) |
|
22 | |||
23 | /** |
||
24 | * Asserts that the given expected string is not the same as the string returned by an object instance's __toString |
||
25 | * magic method. |
||
26 | * |
||
27 | * @param string $expected The string expected not to match |
||
28 | * @param UriPartInterface $test_instance An instance of the object whose __toString method is under test |
||
29 | */ |
||
30 | 2 | public static function assertNotSameAsToString($expected, UriPartInterface $test_instance) |
|
35 | |||
36 | /** |
||
37 | * Asserts that the given data is valid for the given class. |
||
38 | * |
||
39 | * @param mixed $data The data expected to be valid |
||
40 | * @param string $class The class whose isValid method is under test |
||
41 | */ |
||
42 | 59 | public static function assertIsValid($data, $class) |
|
49 | |||
50 | /** |
||
51 | * Asserts that the given data is not valid for the given class. |
||
52 | * |
||
53 | * @param mixed $data The data expected to be not valid |
||
54 | * @param string $class The class whose isValid method is under test |
||
55 | */ |
||
56 | 32 | public static function assertIsNotValid($data, $class) |
|
63 | |||
64 | /** |
||
65 | * Tests whether the constructor of a given class throws an \InvalidArgumentException when attempting to construct |
||
66 | * an instance with invalid data. |
||
67 | * |
||
68 | * @param string $class_name The name of the class to test |
||
69 | * @param mixed $data Data to be passed to the class's constructor |
||
70 | * @param string|null $message [optional] The expected \InvalidArgumentException message |
||
71 | */ |
||
72 | 58 | public static function expectInvalidArgumentExceptionWhenConstructedWithInvalidData( |
|
93 | |||
94 | /** |
||
95 | * Compares a given exceptions message with a given message string. |
||
96 | * |
||
97 | * @throws \PHPUnit_Framework_AssertionFailedError when exception message does not match given message |
||
98 | * |
||
99 | * @param \Exception $exception An exception for message comparison |
||
100 | * @param string $message The intended message |
||
101 | */ |
||
102 | 56 | private static function compareExceptionMessage(\Exception $exception, $message) |
|
112 | } |
||
113 |