From e94009e90df5124ab83aad6a7f6a45806c3ff71b Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 21 Dec 2009 17:26:04 -0800 Subject: Add a helper for doing complex string comparisons --- modules/gallery_unit_test/helpers/diff.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 modules/gallery_unit_test/helpers/diff.php (limited to 'modules/gallery_unit_test/helpers/diff.php') diff --git a/modules/gallery_unit_test/helpers/diff.php b/modules/gallery_unit_test/helpers/diff.php new file mode 100644 index 00000000..1ea16fa6 --- /dev/null +++ b/modules/gallery_unit_test/helpers/diff.php @@ -0,0 +1,26 @@ + Date: Tue, 22 Dec 2009 15:41:47 -0800 Subject: Fix some function definitions (they should be static) --- modules/gallery_unit_test/helpers/MY_request.php | 2 +- modules/gallery_unit_test/helpers/diff.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/gallery_unit_test/helpers/diff.php') diff --git a/modules/gallery_unit_test/helpers/MY_request.php b/modules/gallery_unit_test/helpers/MY_request.php index 9cc9746a..452fb0cc 100644 --- a/modules/gallery_unit_test/helpers/MY_request.php +++ b/modules/gallery_unit_test/helpers/MY_request.php @@ -18,7 +18,7 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class request extends request_Core { - public function set_user_agent($value) { + static function set_user_agent($value) { self::$user_agent = null; $_SERVER["HTTP_USER_AGENT"] = $value; } diff --git a/modules/gallery_unit_test/helpers/diff.php b/modules/gallery_unit_test/helpers/diff.php index 1ea16fa6..7b573732 100644 --- a/modules/gallery_unit_test/helpers/diff.php +++ b/modules/gallery_unit_test/helpers/diff.php @@ -18,7 +18,7 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class diff_Core { - public function compare($a, $b) { + static function compare($a, $b) { fwrite(fopen($a_name = tempnam("/tmp", "test"), "w"), $a); fwrite(fopen($b_name = tempnam("/tmp", "test"), "w"), $b); return `diff $a_name $b_name`; -- cgit v1.2.3