From f99719967955244b63ae01659a39f8b0890a6856 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev <oleg@bsdpower.com> Date: Sun, 7 Aug 2011 16:12:48 -0400 Subject: [PATCH 1/3] [ticket/10309] Write unicode data to tests/tmp. When the tests are run by a different user than the one which owns phpbb source tree, writes will go into a single, known directory. PHPBB3-10309 --- tests/utf/normalizer_test.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/utf/normalizer_test.php b/tests/utf/normalizer_test.php index f78dba8004..5cd68bccfa 100644 --- a/tests/utf/normalizer_test.php +++ b/tests/utf/normalizer_test.php @@ -14,10 +14,13 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_normalizer.php'; */ class phpbb_utf_normalizer_test extends phpbb_test_case { + private static $data_dir; + static public function setUpBeforeClass() { - self::download('http://www.unicode.org/Public/UNIDATA/NormalizationTest.txt', dirname(__FILE__).'/data'); - self::download('http://www.unicode.org/Public/UNIDATA/UnicodeData.txt', dirname(__FILE__).'/data'); + self::$data_dir = dirname(__file__) . '/../tmp'; + self::download('http://www.unicode.org/Public/UNIDATA/NormalizationTest.txt', self::$data_dir); + self::download('http://www.unicode.org/Public/UNIDATA/UnicodeData.txt', self::$data_dir); } public function test_normalizer() @@ -62,7 +65,7 @@ class phpbb_utf_normalizer_test extends phpbb_test_case $tested_chars = array(); - $fp = fopen(dirname(__FILE__).'/data/NormalizationTest.txt', 'rb'); + $fp = fopen(self::$data_dir . '/NormalizationTest.txt', 'rb'); while (!feof($fp)) { $line = fgets($fp); @@ -117,7 +120,7 @@ class phpbb_utf_normalizer_test extends phpbb_test_case */ public function test_invariants(array $tested_chars) { - $fp = fopen(dirname(__FILE__).'/data/UnicodeData.txt', 'rb'); + $fp = fopen(self::$data_dir . '/UnicodeData.txt', 'rb'); while (!feof($fp)) { From 3df8b214cc15d8539f89df5f4a4c19d4cf8f37d0 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev <oleg@bsdpower.com> Date: Tue, 9 Aug 2011 21:16:38 -0400 Subject: [PATCH 2/3] [ticket/10309] Coding guidelines fix. PHPBB3-10309 --- tests/utf/normalizer_test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/utf/normalizer_test.php b/tests/utf/normalizer_test.php index 5cd68bccfa..a0ba470416 100644 --- a/tests/utf/normalizer_test.php +++ b/tests/utf/normalizer_test.php @@ -14,7 +14,7 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_normalizer.php'; */ class phpbb_utf_normalizer_test extends phpbb_test_case { - private static $data_dir; + static private $data_dir; static public function setUpBeforeClass() { From 57accade85a431725af7745230ac26b000ff831a Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev <oleg@bsdpower.com> Date: Sat, 20 Aug 2011 14:34:02 -0400 Subject: [PATCH 3/3] [ticket/10309] Update .gitignore and move .gitkeep. PHPBB3-10309 --- .gitignore | 2 +- tests/{utf/data => tmp}/.gitkeep | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename tests/{utf/data => tmp}/.gitkeep (100%) diff --git a/.gitignore b/.gitignore index 65058b2eaf..7d789c59a1 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,4 @@ /phpBB/store/* /tests/phpbb_unit_tests.sqlite2 /tests/test_config.php -/tests/utf/data/*.txt +/tests/tmp/* diff --git a/tests/utf/data/.gitkeep b/tests/tmp/.gitkeep similarity index 100% rename from tests/utf/data/.gitkeep rename to tests/tmp/.gitkeep