Skip to content

Commit 1d95c8e

Browse files
authored
Format code
1 parent e5e5eba commit 1d95c8e

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

src/AssertableJsonString.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,10 @@ public function assertFragment(array $data)
150150

151151
PHPUnit::assertTrue(
152152
Str::contains($actual, $expected),
153-
'Unable to find JSON fragment: ' . PHP_EOL . PHP_EOL .
154-
'[' . json_encode([$key => $value], JSON_UNESCAPED_UNICODE) . ']' . PHP_EOL . PHP_EOL .
155-
'within' . PHP_EOL . PHP_EOL .
156-
"[{$actual}]."
153+
'Unable to find JSON fragment: ' . PHP_EOL . PHP_EOL
154+
. '[' . json_encode([$key => $value], JSON_UNESCAPED_UNICODE) . ']' . PHP_EOL . PHP_EOL
155+
. 'within' . PHP_EOL . PHP_EOL
156+
. "[{$actual}]."
157157
);
158158
}
159159

@@ -182,10 +182,10 @@ public function assertMissing(array $data, $exact = false)
182182

183183
PHPUnit::assertFalse(
184184
Str::contains($actual, $unexpected),
185-
'Found unexpected JSON fragment: ' . PHP_EOL . PHP_EOL .
186-
'[' . json_encode([$key => $value], JSON_UNESCAPED_UNICODE) . ']' . PHP_EOL . PHP_EOL .
187-
'within' . PHP_EOL . PHP_EOL .
188-
"[{$actual}]."
185+
'Found unexpected JSON fragment: ' . PHP_EOL . PHP_EOL
186+
. '[' . json_encode([$key => $value], JSON_UNESCAPED_UNICODE) . ']' . PHP_EOL . PHP_EOL
187+
. 'within' . PHP_EOL . PHP_EOL
188+
. "[{$actual}]."
189189
);
190190
}
191191

@@ -213,10 +213,10 @@ public function assertMissingExact(array $data)
213213
}
214214

215215
PHPUnit::fail(
216-
'Found unexpected JSON fragment: ' . PHP_EOL . PHP_EOL .
217-
'[' . json_encode($data, JSON_UNESCAPED_UNICODE) . ']' . PHP_EOL . PHP_EOL .
218-
'within' . PHP_EOL . PHP_EOL .
219-
"[{$actual}]."
216+
'Found unexpected JSON fragment: ' . PHP_EOL . PHP_EOL
217+
. '[' . json_encode($data, JSON_UNESCAPED_UNICODE) . ']' . PHP_EOL . PHP_EOL
218+
. 'within' . PHP_EOL . PHP_EOL
219+
. "[{$actual}]."
220220
);
221221
}
222222

@@ -383,10 +383,10 @@ protected function assertJsonMessage(array $data)
383383

384384
$actual = json_encode($this->decoded, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
385385

386-
return 'Unable to find JSON: ' . PHP_EOL . PHP_EOL .
387-
"[{$expected}]" . PHP_EOL . PHP_EOL .
388-
'within response JSON:' . PHP_EOL . PHP_EOL .
389-
"[{$actual}]." . PHP_EOL . PHP_EOL;
386+
return 'Unable to find JSON: ' . PHP_EOL . PHP_EOL
387+
. "[{$expected}]" . PHP_EOL . PHP_EOL
388+
. 'within response JSON:' . PHP_EOL . PHP_EOL
389+
. "[{$actual}]." . PHP_EOL . PHP_EOL;
390390
}
391391

392392
/**

src/Http/TestResponse.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -392,8 +392,8 @@ public function assertJsonValidationErrors($errors, $responseKey = 'errors')
392392
$jsonErrors = Arr::get($this->json(), $responseKey) ?? [];
393393

394394
$errorMessage = $jsonErrors
395-
? 'Response has the following JSON validation errors:' .
396-
PHP_EOL . PHP_EOL . json_encode($jsonErrors, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) . PHP_EOL
395+
? 'Response has the following JSON validation errors:'
396+
. PHP_EOL . PHP_EOL . json_encode($jsonErrors, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) . PHP_EOL
397397
: 'Response does not have JSON validation errors.';
398398

399399
foreach ($errors as $key => $value) {
@@ -439,8 +439,8 @@ public function assertJsonValidationErrorFor($key, $responseKey = 'errors')
439439
$jsonErrors = Arr::get($this->json(), $responseKey) ?? [];
440440

441441
$errorMessage = $jsonErrors
442-
? 'Response has the following JSON validation errors:' .
443-
PHP_EOL . PHP_EOL . json_encode($jsonErrors, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) . PHP_EOL
442+
? 'Response has the following JSON validation errors:'
443+
. PHP_EOL . PHP_EOL . json_encode($jsonErrors, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) . PHP_EOL
444444
: 'Response does not have JSON validation errors.';
445445

446446
PHPUnit::assertArrayHasKey(
@@ -479,8 +479,8 @@ public function assertJsonMissingValidationErrors($keys = null, $responseKey = '
479479

480480
if (is_null($keys) && count($errors) > 0) {
481481
PHPUnit::fail(
482-
'Response has unexpected validation errors: ' . PHP_EOL . PHP_EOL .
483-
json_encode($errors, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE)
482+
'Response has unexpected validation errors: ' . PHP_EOL . PHP_EOL
483+
. json_encode($errors, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE)
484484
);
485485
}
486486

0 commit comments

Comments
 (0)