|
14 | 14 | $myArray = Strictus::array([1, 2, 3]);
|
15 | 15 |
|
16 | 16 | expect($myArray->value)
|
17 |
| - ->toBe([1, 2, 3]) |
| 17 | + ->toEqualCanonicalizing([1, 2, 3]) |
18 | 18 | ->and($myArray())
|
19 |
| - ->toBe([1, 2, 3]); |
| 19 | + ->toEqualCanonicalizing([1, 2, 3]); |
20 | 20 | });
|
21 | 21 |
|
22 | 22 | it('sets the correct array value', function () {
|
23 | 23 | $myArray = Strictus::array([1, 2, 3]);
|
24 | 24 |
|
25 | 25 | expect($myArray->value)
|
26 |
| - ->toBe([1, 2, 3]) |
| 26 | + ->toEqualCanonicalizing([1, 2, 3]) |
27 | 27 | ->and($myArray())
|
28 |
| - ->toBe([1, 2, 3]); |
| 28 | + ->toEqualCanonicalizing([1, 2, 3]); |
29 | 29 |
|
30 | 30 | $myArray->value = [4, 5, 6];
|
31 |
| - expect($myArray)->toBe([4, 5, 6]); |
| 31 | + expect($myArray->value)->toEqualCanonicalizing([4, 5, 6]); |
32 | 32 |
|
33 | 33 | $myArray([7, 8, 9]);
|
34 |
| - expect($myArray)->toBe([7, 8, 9]); |
| 34 | + expect($myArray())->toEqualCanonicalizing([7, 8, 9]); |
35 | 35 | });
|
36 | 36 |
|
37 | 37 | it('instantiates a nullable array variable with array method', function () {
|
|
47 | 47 | });
|
48 | 48 |
|
49 | 49 | it('throws exception when trying to instantiate an array as nullable with array method', function () {
|
50 |
| - expect(Strictus::array(null))->toThrow(StrictusTypeException::class); |
| 50 | + expect(fn() => Strictus::array(null))->toThrow(StrictusTypeException::class); |
51 | 51 | });
|
52 | 52 |
|
53 | 53 | it('throws exception when trying to instantiate an array with wrong type', function () {
|
54 |
| - expect(Strictus::array('foo'))->toThrow(StrictusTypeException::class); |
| 54 | + expect(fn() => Strictus::array('foo'))->toThrow(StrictusTypeException::class); |
55 | 55 | });
|
0 commit comments