feat(expect): add more methods

This commit is contained in:
ceceppa
2020-07-13 17:27:55 +01:00
parent 679082e805
commit 9f62f2d483
12 changed files with 388 additions and 8 deletions

View File

@ -0,0 +1,16 @@
<?php
use PHPUnit\Framework\ExpectationFailedException;
test('pass', function () {
expect('00123')->toEqualCanonicalizing(123);
expect(['a', 'b', 'c'])->toEqualCanonicalizing(['c', 'a', 'b']);
});
test('failures', function () {
expect(['a', 'b', 'c'])->toEqualCanonicalizing(['a', 'b']);
})->throws(ExpectationFailedException::class);
test('not failures', function () {
expect('042')->not->toEqualCanonicalizing(42);
})->throws(ExpectationFailedException::class);