Skip to content

Commit

Permalink
style(TestResponse): Formatting code
Browse files Browse the repository at this point in the history
  • Loading branch information
Albert committed Nov 2, 2018
1 parent 36b1e5a commit 92f9d76
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 deletions.
5 changes: 2 additions & 3 deletions src/Illuminate/Foundation/Testing/TestResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public static function fromBaseResponse($response)
* @param array $arrayAssoc
* @return array
*/
public static function normalizingArraysObjects (array $arrayStdClass, array $arrayAssoc): array
public static function normalizingArraysObjects(array $arrayStdClass, array $arrayAssoc): array
{
$merged = $arrayStdClass;

Expand All @@ -76,7 +76,7 @@ public static function normalizingArraysObjects (array $arrayStdClass, array $ar
}

if (is_array($value)) {
$value = self::normalizingArraysObjects((array)$merged[$key], $value);
$value = self::normalizingArraysObjects((array) $merged[$key], $value);
}

$merged[$key] = $value;
Expand Down Expand Up @@ -485,7 +485,6 @@ public function assertExactJson(array $data)
(array) $this->decodeResponseJson()
));


PHPUnit::assertEquals(json_encode(Arr::sortRecursive($data)), $actual);

return $this;
Expand Down
32 changes: 16 additions & 16 deletions tests/Foundation/FoundationTestResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,37 +243,37 @@ public function testAssertExactJson()
$response = new TestResponse((new JsonResponse([
'payload' => (object) [],
'a' => [],
'b' => (object)[],
'b' => (object) [],
'status' => 'success',
'data' => [
'name' => "West Fannieland",
'updated_at' => "2018-10-05 20:48:11",
'created_at' => "2018-10-05 20:48:11",
'name' => 'West Fannieland',
'updated_at' => '2018-10-05 20:48:11',
'created_at' => '2018-10-05 20:48:11',
'id' => 1,
'b' => (object)[],
'b' => (object) [],
'c' => [
'b' => (object)[],
'name' => 'albert'
'b' => (object) [],
'name' => 'albert',
],
]
],
])));

$response->assertExactJson([
'payload' => (object) [],
'b' => (object)[],
'b' => (object) [],
'a' => [],
'status' => 'success',
'data' => [
'name' => "West Fannieland",
'created_at' => "2018-10-05 20:48:11",
'name' => 'West Fannieland',
'created_at' => '2018-10-05 20:48:11',
'id' => 1,
'b' => (object)[],
'b' => (object) [],
'c' => [
'b' => (object)[],
'name' => 'albert'
'b' => (object) [],
'name' => 'albert',
],
'updated_at' => "2018-10-05 20:48:11"
]
'updated_at' => '2018-10-05 20:48:11',
],
]);
}

Expand Down

0 comments on commit 92f9d76

Please sign in to comment.