| Total Complexity | 4 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | abstract class Assertion |
||
| 13 | { |
||
| 14 | /** @var ReflectionProperty|null */ |
||
| 15 | private static $unBufferedChangesReflection; |
||
| 16 | |||
| 17 | final private function __construct() |
||
| 18 | { |
||
| 19 | } |
||
| 20 | |||
| 21 | public static function assertChangesEqual( |
||
| 22 | Changes $expected, |
||
| 23 | Changes $actual, |
||
| 24 | string $message = '' |
||
| 25 | ) : void { |
||
| 26 | Assert::assertNotNull( |
||
| 27 | self::reflectionUnBufferedChanges()->getValue($actual), |
||
| 28 | 'Buffer must NOT be exhausted' |
||
| 29 | ); |
||
| 30 | // Forces eager initialisation of the `Changes` instances, allowing us to compare them by value |
||
| 31 | Assert::assertCount(count($expected), $actual); |
||
| 32 | Assert::assertEquals($expected, $actual, $message); |
||
| 33 | } |
||
| 34 | |||
| 35 | private static function reflectionUnBufferedChanges() : ReflectionProperty |
||
| 46 | } |
||
| 47 | } |
||
| 48 |