diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2013-08-03 15:37:01 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2013-08-03 15:37:01 +0200 |
commit | 78623bf2ff3bf101d22abd839a743d9088968ff5 (patch) | |
tree | 3cedfcb3738545de3ef5a4aeeff5690488ecb682 /tests | |
parent | 73040c6d1d7ad161f7ef316e4e6e096fe8e90d14 (diff) | |
parent | 33eb9ad53aca850586abe8d896cd718181d480c0 (diff) | |
download | forums-78623bf2ff3bf101d22abd839a743d9088968ff5.tar forums-78623bf2ff3bf101d22abd839a743d9088968ff5.tar.gz forums-78623bf2ff3bf101d22abd839a743d9088968ff5.tar.bz2 forums-78623bf2ff3bf101d22abd839a743d9088968ff5.tar.xz forums-78623bf2ff3bf101d22abd839a743d9088968ff5.zip |
Merge branch 'develop-olympus' into develop
* develop-olympus:
[ticket/11762] Added call to test class's parent::setUp().
[ticket/11762] Fixed test's filename
[ticket/11762] Use the === operator to distinguish "0" from ""
Diffstat (limited to 'tests')
-rw-r--r-- | tests/text_processing/generate_text_for_display_test.php | 38 |
1 files changed, 38 insertions, 0 deletions
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..a157fe7d9a --- /dev/null +++ b/tests/text_processing/generate_text_for_display_test.php @@ -0,0 +1,38 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2013 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; + + parent::setUp(); + + $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)); + } +} |