From 8a02db317ef3c2d3c4e3dcfc5f8b85397f7ebb4a Mon Sep 17 00:00:00 2001 From: s9e Date: Sat, 3 Aug 2013 12:20:52 +0200 Subject: [ticket/11762] Use the === operator to distinguish "0" from "" PHPBB3-11762 --- .../text_processing/generate_text_for_display.php | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 tests/text_processing/generate_text_for_display.php (limited to 'tests/text_processing') diff --git a/tests/text_processing/generate_text_for_display.php b/tests/text_processing/generate_text_for_display.php new file mode 100644 index 0000000000..4088e33f30 --- /dev/null +++ b/tests/text_processing/generate_text_for_display.php @@ -0,0 +1,36 @@ +optionset('viewcensors', false); + } + + public function test_empty_string() + { + $this->assertSame('', generate_text_for_display('', '', '', 0)); + } + + public function test_zero_string() + { + $this->assertSame('0', generate_text_for_display('0', '', '', 0)); + } +} -- cgit v1.2.1 From 68aa974a207b444199fabe9d754f403d27d700ad Mon Sep 17 00:00:00 2001 From: s9e Date: Sat, 3 Aug 2013 12:29:23 +0200 Subject: [ticket/11762] Fixed test's filename PHPBB3-11762 --- .../text_processing/generate_text_for_display.php | 36 ---------------------- .../generate_text_for_display_test.php | 36 ++++++++++++++++++++++ 2 files changed, 36 insertions(+), 36 deletions(-) delete mode 100644 tests/text_processing/generate_text_for_display.php create mode 100644 tests/text_processing/generate_text_for_display_test.php (limited to 'tests/text_processing') diff --git a/tests/text_processing/generate_text_for_display.php b/tests/text_processing/generate_text_for_display.php deleted file mode 100644 index 4088e33f30..0000000000 --- a/tests/text_processing/generate_text_for_display.php +++ /dev/null @@ -1,36 +0,0 @@ -optionset('viewcensors', false); - } - - public function test_empty_string() - { - $this->assertSame('', generate_text_for_display('', '', '', 0)); - } - - public function test_zero_string() - { - $this->assertSame('0', generate_text_for_display('0', '', '', 0)); - } -} diff --git a/tests/text_processing/generate_text_for_display_test.php b/tests/text_processing/generate_text_for_display_test.php new file mode 100644 index 0000000000..4088e33f30 --- /dev/null +++ b/tests/text_processing/generate_text_for_display_test.php @@ -0,0 +1,36 @@ +optionset('viewcensors', false); + } + + public function test_empty_string() + { + $this->assertSame('', generate_text_for_display('', '', '', 0)); + } + + public function test_zero_string() + { + $this->assertSame('0', generate_text_for_display('0', '', '', 0)); + } +} -- cgit v1.2.1 From 9db1728b4b976c99f5811e578619e37c69e306cd Mon Sep 17 00:00:00 2001 From: s9e Date: Sat, 3 Aug 2013 14:05:40 +0200 Subject: [ticket/11762] Added call to test class's parent::setUp(). Added call to test class's parent::setUp(). Updated copyright year. PHPBB3-11762 --- tests/text_processing/generate_text_for_display_test.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tests/text_processing') diff --git a/tests/text_processing/generate_text_for_display_test.php b/tests/text_processing/generate_text_for_display_test.php index 4088e33f30..a157fe7d9a 100644 --- a/tests/text_processing/generate_text_for_display_test.php +++ b/tests/text_processing/generate_text_for_display_test.php @@ -2,7 +2,7 @@ /** * * @package testing -* @copyright (c) 2011 phpBB Group +* @copyright (c) 2013 phpBB Group * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ @@ -18,6 +18,8 @@ class phpbb_text_processing_generate_text_for_display_test extends phpbb_test_ca { global $cache, $user; + parent::setUp(); + $cache = new phpbb_mock_cache; $user = new phpbb_mock_user; -- cgit v1.2.1