From afd6f86892fbbbe06aa0b1295dba361fab29fd5f Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Mon, 11 Jun 2012 13:22:11 +0200 Subject: [ticket/10931] Unit tests for phpbb_php_ini class. PHPBB3-10931 --- tests/mock/phpbb_php_ini.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tests/mock/phpbb_php_ini.php (limited to 'tests/mock') diff --git a/tests/mock/phpbb_php_ini.php b/tests/mock/phpbb_php_ini.php new file mode 100644 index 0000000000..249c1b014a --- /dev/null +++ b/tests/mock/phpbb_php_ini.php @@ -0,0 +1,16 @@ + Date: Mon, 11 Jun 2012 14:18:21 +0200 Subject: [ticket/10931] Make it clear that we are mocking the ini_get() function. PHPBB3-10931 --- tests/mock/phpbb_php_ini.php | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 tests/mock/phpbb_php_ini.php (limited to 'tests/mock') diff --git a/tests/mock/phpbb_php_ini.php b/tests/mock/phpbb_php_ini.php deleted file mode 100644 index 249c1b014a..0000000000 --- a/tests/mock/phpbb_php_ini.php +++ /dev/null @@ -1,16 +0,0 @@ - Date: Sun, 8 Jul 2012 22:35:50 +0200 Subject: [ticket/10974] Rename tests/mock_user.php -> tests/mock/user.php PHPBB3-10974 --- tests/mock/user.php | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 tests/mock/user.php (limited to 'tests/mock') diff --git a/tests/mock/user.php b/tests/mock/user.php new file mode 100644 index 0000000000..ec14ce430e --- /dev/null +++ b/tests/mock/user.php @@ -0,0 +1,36 @@ + '/'); + + private $options = array(); + public function optionget($item) + { + if (!isset($this->options[$item])) + { + throw new Exception(sprintf("You didn't set the option '%s' on the mock user using optionset.", $item)); + } + + return $this->options[$item]; + } + + public function optionset($item, $value) + { + $this->options[$item] = $value; + } +} -- cgit v1.2.1 From 33a13002af3a0a7c6c890393a40b03e92707d934 Mon Sep 17 00:00:00 2001 From: Fyorl Date: Wed, 20 Jun 2012 22:15:59 +0100 Subject: [ticket/10941] Unit tests for filespec class PHPBB3-10941 --- tests/mock/fileupload.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/mock/fileupload.php (limited to 'tests/mock') diff --git a/tests/mock/fileupload.php b/tests/mock/fileupload.php new file mode 100644 index 0000000000..cbcbf4a6ab --- /dev/null +++ b/tests/mock/fileupload.php @@ -0,0 +1,23 @@ + Date: Thu, 21 Jun 2012 14:27:39 +0100 Subject: [ticket/10941] Finished filespec tests PHPBB3-10941 --- tests/mock/fileupload.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'tests/mock') diff --git a/tests/mock/fileupload.php b/tests/mock/fileupload.php index cbcbf4a6ab..817b090346 100644 --- a/tests/mock/fileupload.php +++ b/tests/mock/fileupload.php @@ -20,4 +20,26 @@ class phpbb_mock_fileupload { return true; } + + public function image_types() + { + return array( + IMAGETYPE_GIF => array('gif'), + IMAGETYPE_JPEG => array('jpg', 'jpeg'), + IMAGETYPE_PNG => array('png'), + IMAGETYPE_SWF => array('swf'), + IMAGETYPE_PSD => array('psd'), + IMAGETYPE_BMP => array('bmp'), + IMAGETYPE_TIFF_II => array('tif', 'tiff'), + IMAGETYPE_TIFF_MM => array('tif', 'tiff'), + IMAGETYPE_JPC => array('jpg', 'jpeg'), + IMAGETYPE_JP2 => array('jpg', 'jpeg'), + IMAGETYPE_JPX => array('jpg', 'jpeg'), + IMAGETYPE_JB2 => array('jpg', 'jpeg'), + IMAGETYPE_SWC => array('swc'), + IMAGETYPE_IFF => array('iff'), + IMAGETYPE_WBMP => array('wbmp'), + IMAGETYPE_XBM => array('xbm'), + ); + } } -- cgit v1.2.1 From dfef80f267f19b21dbf5b94ac43ecc856da65aef Mon Sep 17 00:00:00 2001 From: Fyorl Date: Thu, 21 Jun 2012 16:42:09 +0100 Subject: [ticket/10941] Unit tests for fileupload class added PHPBB3-10941 --- tests/mock/filespec.php | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 tests/mock/filespec.php (limited to 'tests/mock') diff --git a/tests/mock/filespec.php b/tests/mock/filespec.php new file mode 100644 index 0000000000..9d2a5c84de --- /dev/null +++ b/tests/mock/filespec.php @@ -0,0 +1,32 @@ +$property; + } +} -- cgit v1.2.1 From d89af53f6311d9f4cec60d136cf017df9e1a36cd Mon Sep 17 00:00:00 2001 From: Fyorl Date: Sun, 8 Jul 2012 02:15:48 +0100 Subject: [ticket/10941] Added some comments for clarification PHPBB3-10941 --- tests/mock/fileupload.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/mock') diff --git a/tests/mock/fileupload.php b/tests/mock/fileupload.php index 817b090346..409036ba63 100644 --- a/tests/mock/fileupload.php +++ b/tests/mock/fileupload.php @@ -21,6 +21,13 @@ class phpbb_mock_fileupload return true; } + /** + * Copied verbatim from phpBB/includes/functions_upload.php's fileupload + * class to ensure the correct behaviour of filespec::move_file. + * + * Maps file extensions to the constant in second index of the array + * returned by getimagesize() + */ public function image_types() { return array( -- cgit v1.2.1