aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authors9e <s9e.dev@gmail.com>2013-08-03 12:20:52 +0200
committers9e <s9e.dev@gmail.com>2013-08-03 12:20:52 +0200
commit8a02db317ef3c2d3c4e3dcfc5f8b85397f7ebb4a (patch)
tree22a8067bb6cdd29c08d83193b3f6ebcbc780249f /tests
parentb7f97cae792af90e9192570c17d6d91fc901e9ca (diff)
downloadforums-8a02db317ef3c2d3c4e3dcfc5f8b85397f7ebb4a.tar
forums-8a02db317ef3c2d3c4e3dcfc5f8b85397f7ebb4a.tar.gz
forums-8a02db317ef3c2d3c4e3dcfc5f8b85397f7ebb4a.tar.bz2
forums-8a02db317ef3c2d3c4e3dcfc5f8b85397f7ebb4a.tar.xz
forums-8a02db317ef3c2d3c4e3dcfc5f8b85397f7ebb4a.zip
[ticket/11762] Use the === operator to distinguish "0" from ""
PHPBB3-11762
Diffstat (limited to 'tests')
-rw-r--r--tests/text_processing/generate_text_for_display.php36
1 files changed, 36 insertions, 0 deletions
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 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2011 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
+require_once dirname(__FILE__) . '/../mock/user.php';
+require_once dirname(__FILE__) . '/../mock/cache.php';
+
+class phpbb_text_processing_generate_text_for_display_test extends phpbb_test_case
+{
+ public function setUp()
+ {
+ global $cache, $user;
+
+ $cache = new phpbb_mock_cache;
+
+ $user = new phpbb_mock_user;
+ $user->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));
+ }
+}