@@ -12,23 +12,23 @@ |
||
| 12 | 12 | /** |
| 13 | 13 | * @test |
| 14 | 14 | */ |
| 15 | - public function it_can_return_errors(): void |
|
| 16 | - { |
|
| 17 | - $error1 = new ValidationError(null, ['e1dp1', 'e1dp2'], [], false, 'kw1'); |
|
| 18 | - $error2 = new ValidationError(null, ['e2dp1', 'e2dp2'], [], false, 'kw2'); |
|
| 15 | + public function it_can_return_errors(): void |
|
| 16 | + { |
|
| 17 | + $error1 = new ValidationError(null, ['e1dp1', 'e1dp2'], [], false, 'kw1'); |
|
| 18 | + $error2 = new ValidationError(null, ['e2dp1', 'e2dp2'], [], false, 'kw2'); |
|
| 19 | 19 | |
| 20 | - $exception = ArrayAccessValidationFailed::withValidationErrors($error1, $error2); |
|
| 20 | + $exception = ArrayAccessValidationFailed::withValidationErrors($error1, $error2); |
|
| 21 | 21 | |
| 22 | - static::assertSame( |
|
| 23 | - [ |
|
| 24 | - 'e1dp1' => [ |
|
| 25 | - 'e1dp2' => 'kw1' |
|
| 26 | - ], |
|
| 27 | - 'e2dp1' => [ |
|
| 28 | - 'e2dp2' => 'kw2' |
|
| 29 | - ], |
|
| 30 | - ], |
|
| 31 | - $exception->errorMapping()->data() |
|
| 32 | - ); |
|
| 33 | - } |
|
| 22 | + static::assertSame( |
|
| 23 | + [ |
|
| 24 | + 'e1dp1' => [ |
|
| 25 | + 'e1dp2' => 'kw1' |
|
| 26 | + ], |
|
| 27 | + 'e2dp1' => [ |
|
| 28 | + 'e2dp2' => 'kw2' |
|
| 29 | + ], |
|
| 30 | + ], |
|
| 31 | + $exception->errorMapping()->data() |
|
| 32 | + ); |
|
| 33 | + } |
|
| 34 | 34 | } |
| 35 | 35 | \ No newline at end of file |
@@ -176,24 +176,24 @@ |
||
| 176 | 176 | /** |
| 177 | 177 | * @test |
| 178 | 178 | */ |
| 179 | - public function it_can_write_value_at_single_path(): void |
|
| 180 | - { |
|
| 181 | - $access = ArrayAccess::create([]); |
|
| 182 | - $newAccess = $access->writeAtPath('new-value', 'Foo'); |
|
| 183 | - |
|
| 184 | - static::assertSame('new-value', $newAccess->string('Foo')); |
|
| 185 | - } |
|
| 186 | - |
|
| 187 | - /** |
|
| 188 | - * @test |
|
| 189 | - */ |
|
| 190 | - public function it_can_write_empty_array(): void |
|
| 191 | - { |
|
| 192 | - $access = ArrayAccess::create([]); |
|
| 193 | - $access = $access->writeAtPath([], '0'); |
|
| 194 | - |
|
| 195 | - static::assertSame([], $access->array(0)); |
|
| 196 | - } |
|
| 179 | + public function it_can_write_value_at_single_path(): void |
|
| 180 | + { |
|
| 181 | + $access = ArrayAccess::create([]); |
|
| 182 | + $newAccess = $access->writeAtPath('new-value', 'Foo'); |
|
| 183 | + |
|
| 184 | + static::assertSame('new-value', $newAccess->string('Foo')); |
|
| 185 | + } |
|
| 186 | + |
|
| 187 | + /** |
|
| 188 | + * @test |
|
| 189 | + */ |
|
| 190 | + public function it_can_write_empty_array(): void |
|
| 191 | + { |
|
| 192 | + $access = ArrayAccess::create([]); |
|
| 193 | + $access = $access->writeAtPath([], '0'); |
|
| 194 | + |
|
| 195 | + static::assertSame([], $access->array(0)); |
|
| 196 | + } |
|
| 197 | 197 | |
| 198 | 198 | /** |
| 199 | 199 | * @test |