diff --git a/JsonHelper.php b/JsonHelper.php new file mode 100644 index 0000000..354d085 --- /dev/null +++ b/JsonHelper.php @@ -0,0 +1,22 @@ + array( + "username" => "username", + "email" => "localhost@email.com" + ) + ); + self::assertEquals("localhost@email.com", JsonHelper::extractValue($json_array, "user.email")); + self::assertEquals("username", JsonHelper::extractValue($json_array, "user.username")); + self::assertEquals("username", JsonHelper::extractValue($json_array, "user")["username"]); + self::assertNull(JsonHelper::extractValue($json_array, "user.emails")); + self::assertNull(JsonHelper::extractValue($json_array, "$.user.email")); + } + + protected function tearDown() + { + parent::tearDown(); + } +}