From 66fbbab9071e73df01b316bb29842fdc3b29c39c Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 20 Jan 2010 00:06:36 -0800 Subject: Add assert_array_equal_to_json(). --- modules/gallery_unit_test/libraries/Gallery_Unit_Test_Case.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'modules') diff --git a/modules/gallery_unit_test/libraries/Gallery_Unit_Test_Case.php b/modules/gallery_unit_test/libraries/Gallery_Unit_Test_Case.php index 81bd3330..509b4125 100644 --- a/modules/gallery_unit_test/libraries/Gallery_Unit_Test_Case.php +++ b/modules/gallery_unit_test/libraries/Gallery_Unit_Test_Case.php @@ -29,4 +29,8 @@ class Gallery_Unit_Test_Case extends Unit_Test_Case { } return $this; } + + public function assert_array_equal_to_json($expected_array, $actual_json, $debug=null) { + return $this->assert_equal_array($expected_array, json_decode($actual_json, true), $debug); + } } -- cgit v1.2.3