1 | <?php |
||
8 | trait ArrayAssertsTrait |
||
9 | { |
||
10 | /** |
||
11 | * Asserts the given $actual array is the same as the $expected array disregarding index order |
||
12 | * |
||
13 | * @param array $expected The expected array. |
||
14 | * @param mixed $actual The actual array. |
||
15 | * @param string|null $prefix Prefix to use with error messages. Useful for nested arrays. |
||
16 | * |
||
17 | * @return void |
||
18 | */ |
||
19 | public function assertSameArray(array $expected, $actual, $prefix = null) |
||
70 | |||
71 | /** |
||
72 | * Asserts the number of elements of an array, Countable or Traversable. |
||
73 | * |
||
74 | * Ensures this method must be provided by classes using this trait. |
||
75 | * |
||
76 | * @param integer $expectedCount The expected number of items in $haystack. |
||
77 | * @param mixed $haystack The array, countable or traversable object containing items. |
||
78 | * @param string $message Optional error message to give upon failure. |
||
79 | * |
||
80 | * @return void |
||
81 | */ |
||
82 | abstract public function assertCount($expectedCount, $haystack, $message = ''); |
||
83 | |||
84 | /** |
||
85 | * Asserts that a variable is of a given type. |
||
86 | * |
||
87 | * Ensures this method must be provided by classes using this trait. |
||
88 | * |
||
89 | * @param string $expected The expected internal type. |
||
90 | * @param mixed $haystack The variable to verify. |
||
91 | * @param string $message Optional error message to give upon failure. |
||
92 | * |
||
93 | * @return void |
||
94 | */ |
||
95 | abstract public function assertInternalType($expected, $actual, $message = ''); |
||
96 | } |
||
97 |
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.