From 1dea0286a48b4bac6702aad673e13e281690adfb Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Fri, 12 Jul 2013 15:40:49 -0400 Subject: [ticket/11574] Use alternate DI config file for updater PHPBB3-11574 --- tests/di/create_container_test.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/di/create_container_test.php b/tests/di/create_container_test.php index 6de8803df9..d6a5ec823b 100644 --- a/tests/di/create_container_test.php +++ b/tests/di/create_container_test.php @@ -17,7 +17,7 @@ class phpbb_di_container_test extends phpbb_test_case $phpbb_root_path = __DIR__ . '/../../phpBB/'; $extensions = array( new phpbb_di_extension_config(__DIR__ . '/fixtures/config.php'), - new phpbb_di_extension_core($phpbb_root_path), + new phpbb_di_extension_core($phpbb_root_path . 'config'), ); $container = phpbb_create_container($extensions, $phpbb_root_path, 'php'); @@ -29,7 +29,7 @@ class phpbb_di_container_test extends phpbb_test_case $phpbb_root_path = __DIR__ . '/../../phpBB/'; $extensions = array( new phpbb_di_extension_config(__DIR__ . '/fixtures/config.php'), - new phpbb_di_extension_core($phpbb_root_path), + new phpbb_di_extension_core($phpbb_root_path . 'config'), ); $container = phpbb_create_install_container($phpbb_root_path, 'php'); @@ -42,7 +42,7 @@ class phpbb_di_container_test extends phpbb_test_case $phpbb_root_path = __DIR__ . '/../../phpBB/'; $extensions = array( new phpbb_di_extension_config(__DIR__ . '/fixtures/config.php'), - new phpbb_di_extension_core($phpbb_root_path), + new phpbb_di_extension_core($phpbb_root_path . 'config'), ); $container = phpbb_create_compiled_container($extensions, array(), $phpbb_root_path, 'php'); -- cgit v1.2.1 From c0b9db1c626c88780b2ee5f5a237561a125c54aa Mon Sep 17 00:00:00 2001 From: Nathaniel Guse Date: Sun, 14 Jul 2013 14:10:11 -0500 Subject: [ticket/11701] Fix loops var check PHPBB3-11701 --- tests/template/template_test.php | 32 +++++++++++------------ tests/template/templates/include_loop.html | 8 +++--- tests/template/templates/include_loop_define.html | 6 ++--- tests/template/templates/loop.html | 14 +++++----- tests/template/templates/loop_advanced.html | 20 +++++++------- tests/template/templates/loop_size.html | 10 +++---- tests/template/templates/loop_vars.html | 18 ++++++------- 7 files changed, 54 insertions(+), 54 deletions(-) (limited to 'tests') diff --git a/tests/template/template_test.php b/tests/template/template_test.php index dd9ba21c26..0a6b680100 100644 --- a/tests/template/template_test.php +++ b/tests/template/template_test.php @@ -93,49 +93,49 @@ class phpbb_template_template_test extends phpbb_template_template_test_case array( 'loop.html', array(), - array('loop' => array(array())), + array('test_loop' => array(array())), array(), "loop\nloop", ), array( 'loop.html', array(), - array('loop' => array(array(), array()), 'loop.block' => array(array())), + array('test_loop' => array(array(), array()), 'test_loop.block' => array(array())), array(), "loop\nloop\nloop\nloop", ), array( 'loop.html', array(), - array('loop' => array(array(), array()), 'loop.block' => array(array()), 'block' => array(array(), array())), + array('test_loop' => array(array(), array()), 'test_loop.block' => array(array()), 'block' => array(array(), array())), array(), "loop\nloop\nloop\nloop\nloop#0-block#0\nloop#0-block#1\nloop#1-block#0\nloop#1-block#1", ), array( 'loop_vars.html', array(), - array('loop' => array(array('VARIABLE' => 'x'))), + array('test_loop' => array(array('VARIABLE' => 'x'))), array(), "first\n0 - a\nx - b\nset\nlast", ), array( 'loop_vars.html', array(), - array('loop' => array(array('VARIABLE' => 'x'), array('VARIABLE' => 'y'))), + array('test_loop' => array(array('VARIABLE' => 'x'), array('VARIABLE' => 'y'))), array(), "first\n0 - a\nx - b\nset\n1 - a\ny - b\nset\nlast", ), array( 'loop_vars.html', array(), - array('loop' => array(array('VARIABLE' => 'x'), array('VARIABLE' => 'y')), 'loop.inner' => array(array(), array())), + array('test_loop' => array(array('VARIABLE' => 'x'), array('VARIABLE' => 'y')), 'test_loop.inner' => array(array(), array())), array(), "first\n0 - a\nx - b\nset\n1 - a\ny - b\nset\nlast\n0 - c\n1 - c\nlast inner", ), array( 'loop_advanced.html', array(), - array('loop' => array(array(), array(), array(), array(), array(), array(), array())), + array('test_loop' => array(array(), array(), array(), array(), array(), array(), array())), array(), "101234561\nx\n101234561\nx\n101234561\nx\n1234561\nx\n1\nx\n101\nx\n234\nx\n10\nx\n561\nx\n561", ), @@ -149,14 +149,14 @@ class phpbb_template_template_test extends phpbb_template_template_test_case array( 'define.html', array(), - array('loop' => array(array(), array(), array(), array(), array(), array(), array()), 'test' => array(array()), 'test.deep' => array(array()), 'test.deep.defines' => array(array())), + array('test_loop' => array(array(), array(), array(), array(), array(), array(), array()), 'test' => array(array()), 'test.deep' => array(array()), 'test.deep.defines' => array(array())), array(), "xyz\nabc\n\$VALUE == 'abc'abc\nbar\nbar\nabc\ntest!@#$%^&*()_-=+{}[]:;\",<.>/?", ), array( 'define_advanced.html', array(), - array('loop' => array(array(), array(), array(), array(), array(), array(), array()), 'test' => array(array()), 'test.deep' => array(array()), 'test.deep.defines' => array(array())), + array('test_loop' => array(array(), array(), array(), array(), array(), array(), array()), 'test' => array(array()), 'test.deep' => array(array()), 'test.deep.defines' => array(array())), array(), "abc\nzxc\ncde\nbcd", ), @@ -200,7 +200,7 @@ class phpbb_template_template_test extends phpbb_template_template_test_case array( 'include_loop.html', array(), - array('loop' => array(array('NESTED_FILE' => 'include_loop1.html')), 'loop.inner' => array(array('NESTED_FILE' => 'include_loop1.html'), array('NESTED_FILE' => 'include_loop2.html'), array('NESTED_FILE' => 'include_loop3.html'))), + array('test_loop' => array(array('NESTED_FILE' => 'include_loop1.html')), 'test_loop.inner' => array(array('NESTED_FILE' => 'include_loop1.html'), array('NESTED_FILE' => 'include_loop2.html'), array('NESTED_FILE' => 'include_loop3.html'))), array(), "1\n_1\n_02\n_3", ), @@ -221,8 +221,8 @@ class phpbb_template_template_test extends phpbb_template_template_test_case array( 'loop_vars.html', array(), - array('loop' => array(array('VARIABLE' => 'x'), array('VARIABLE' => 'y')), 'loop.inner' => array(array(), array())), - array('loop'), + array('test_loop' => array(array('VARIABLE' => 'x'), array('VARIABLE' => 'y')), 'test_loop.inner' => array(array(), array())), + array('test_loop'), '', ), array( @@ -235,7 +235,7 @@ class phpbb_template_template_test extends phpbb_template_template_test_case array( 'include_loop_define.html', array('VARIABLE' => 'value'), - array('loop' => array(array('NESTED_FILE' => 'variable.html'))), + array('test_loop' => array(array('NESTED_FILE' => 'variable.html'))), array(), 'value', ), @@ -243,8 +243,8 @@ class phpbb_template_template_test extends phpbb_template_template_test_case array( 'loop_vars.html', array(), - array('loop' => array(array('VARIABLE' => 'x'), array('VARIABLE' => 'y')), 'loop.inner' => array(array(), array())), - array('loop.inner'), + array('test_loop' => array(array('VARIABLE' => 'x'), array('VARIABLE' => 'y')), 'test_loop.inner' => array(array(), array())), + array('test_loop.inner'), "first\n0\n0\n2\nx\nset\n1\n1\n2\ny\nset\nlast", ),*/ array( @@ -295,7 +295,7 @@ class phpbb_template_template_test extends phpbb_template_template_test_case array( 'loop_size.html', array(), - array('loop' => array(array()), 'empty_loop' => array()), + array('test_loop' => array(array()), 'empty_loop' => array()), array(), "nonexistent = 0\n! nonexistent\n\nempty = 0\n! empty\nloop\n\nin loop", ), diff --git a/tests/template/templates/include_loop.html b/tests/template/templates/include_loop.html index d5c3d9bc82..5cad34b363 100644 --- a/tests/template/templates/include_loop.html +++ b/tests/template/templates/include_loop.html @@ -1,4 +1,4 @@ - - -_ - + + +_ + diff --git a/tests/template/templates/include_loop_define.html b/tests/template/templates/include_loop_define.html index f539b21396..4bab09422e 100644 --- a/tests/template/templates/include_loop_define.html +++ b/tests/template/templates/include_loop_define.html @@ -1,4 +1,4 @@ - - + + - + diff --git a/tests/template/templates/loop.html b/tests/template/templates/loop.html index de1a10004d..f541e934df 100644 --- a/tests/template/templates/loop.html +++ b/tests/template/templates/loop.html @@ -1,21 +1,21 @@ - + loop noloop - + - + loop noloop - + loop - + -loop#{loop.S_ROW_COUNT}-block#{block.S_ROW_COUNT} +loop#{test_loop.S_ROW_COUNT}-block#{block.S_ROW_COUNT} - + diff --git a/tests/template/templates/loop_advanced.html b/tests/template/templates/loop_advanced.html index c75fe55f03..1f56686eaa 100644 --- a/tests/template/templates/loop_advanced.html +++ b/tests/template/templates/loop_advanced.html @@ -1,19 +1,19 @@ -{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW} +{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW} x -{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW} +{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW} x -{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW} +{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW} x -{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW} +{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW} x -{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW} +{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW} x -{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW} +{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW} x -{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW} +{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW} x -{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW} +{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW} x -{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW} +{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW} x -{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW} +{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW} diff --git a/tests/template/templates/loop_size.html b/tests/template/templates/loop_size.html index 8f581cef10..2b1fcd2dd4 100644 --- a/tests/template/templates/loop_size.html +++ b/tests/template/templates/loop_size.html @@ -22,18 +22,18 @@ ! empty - + loop - + loop = 0 - + ! loop - + in loop - + diff --git a/tests/template/templates/loop_vars.html b/tests/template/templates/loop_vars.html index 7d86d4b7b6..70a3eb2cec 100644 --- a/tests/template/templates/loop_vars.html +++ b/tests/template/templates/loop_vars.html @@ -1,13 +1,13 @@ - -first -{loop.S_ROW_NUM} - a -{loop.VARIABLE} - b -set - + +first +{test_loop.S_ROW_NUM} - a +{test_loop.VARIABLE} - b +set + last -{inner.S_ROW_NUM} - c -last inner +{test_loop.inner.S_ROW_NUM} - c +last inner - + -- cgit v1.2.1 From 30bfd7fb61bbe1d7ca50290730d8c4b6094c41a4 Mon Sep 17 00:00:00 2001 From: Nathaniel Guse Date: Fri, 19 Jul 2013 13:25:53 -0500 Subject: [ticket/11701] Test events in loops PHPBB3-11701 --- .../ext/trivial/styles/all/template/test_event_loop.html | 1 + .../ext_trivial/styles/silver/template/event_loop.html | 3 +++ tests/template/template_events_test.php | 10 ++++++++++ 3 files changed, 14 insertions(+) create mode 100644 tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/test_event_loop.html create mode 100644 tests/template/datasets/ext_trivial/styles/silver/template/event_loop.html (limited to 'tests') diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/test_event_loop.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/test_event_loop.html new file mode 100644 index 0000000000..149398d6bd --- /dev/null +++ b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/test_event_loop.html @@ -0,0 +1 @@ +{event_loop.S_ROW_COUNT}| \ No newline at end of file diff --git a/tests/template/datasets/ext_trivial/styles/silver/template/event_loop.html b/tests/template/datasets/ext_trivial/styles/silver/template/event_loop.html new file mode 100644 index 0000000000..c70d8f86d7 --- /dev/null +++ b/tests/template/datasets/ext_trivial/styles/silver/template/event_loop.html @@ -0,0 +1,3 @@ + +event_loop + diff --git a/tests/template/template_events_test.php b/tests/template/template_events_test.php index f7bcd2dcc6..d3b65e763a 100644 --- a/tests/template/template_events_test.php +++ b/tests/template/template_events_test.php @@ -80,6 +80,16 @@ Zeta test event in all', array(), 'two in silver in omega', ), + array( + 'EVENT in loop', + 'ext_trivial', + array('silver'), + 'event_loop.html', + array(), + array('event_loop' => array(array(), array(), array())), + array(), + 'event_loop0|event_loop1|event_loop2', + ), ); } -- cgit v1.2.1 From 0f83d7fd6cf6819c0fe2f4bfa9f65873f7124b72 Mon Sep 17 00:00:00 2001 From: Nathaniel Guse Date: Fri, 19 Jul 2013 13:36:28 -0500 Subject: [ticket/11701] New line at EOF PHPBB3-11701 --- .../ext_trivial/ext/trivial/styles/all/template/test_event_loop.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/test_event_loop.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/test_event_loop.html index 149398d6bd..235e129f85 100644 --- a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/test_event_loop.html +++ b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/test_event_loop.html @@ -1 +1 @@ -{event_loop.S_ROW_COUNT}| \ No newline at end of file +{event_loop.S_ROW_COUNT}| -- cgit v1.2.1 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') 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') 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') 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 From 2508439b02f5115e0557b2eee467e5ec5737d350 Mon Sep 17 00:00:00 2001 From: Andy Chase Date: Mon, 5 Aug 2013 10:35:39 -0700 Subject: [ticket/11761] Serve blank file locally in functional test Example.org no longer serves blank responses, failing functional tests. this patch creates a blank file and serve it locally during the test, instead of hitting the http://example.org servers kindly provided by IANA. PHPBB3-11761 --- tests/functional/fileupload_remote_test.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/functional/fileupload_remote_test.php b/tests/functional/fileupload_remote_test.php index 8e361ab77b..65c4b6b7c4 100644 --- a/tests/functional/fileupload_remote_test.php +++ b/tests/functional/fileupload_remote_test.php @@ -44,14 +44,14 @@ class phpbb_functional_fileupload_remote_test extends phpbb_functional_test_case public function test_invalid_extension() { $upload = new fileupload('', array('jpg'), 100); - $file = $upload->remote_upload('http://example.com/image.gif'); + $file = $upload->remote_upload(self::$root_url . 'develop/blank.gif'); $this->assertEquals('URL_INVALID', $file->error[0]); } - public function test_non_existant() + public function test_empty_file() { $upload = new fileupload('', array('jpg'), 100); - $file = $upload->remote_upload('http://example.com/image.jpg'); + $file = $upload->remote_upload(self::$root_url . 'develop/blank.jpg'); $this->assertEquals('EMPTY_REMOTE_DATA', $file->error[0]); } -- cgit v1.2.1 From a6e69f377bb436fe59eed9fdedc0cd735d8d8ce9 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 8 Aug 2013 23:33:26 +0200 Subject: [ticket/11775] Backport moving of the posting functions to 3.0 PHPBB3-11775 --- tests/functional/posting_test.php | 101 ---------------- .../test_framework/phpbb_functional_test_case.php | 131 +++++++++++++++++++++ 2 files changed, 131 insertions(+), 101 deletions(-) (limited to 'tests') diff --git a/tests/functional/posting_test.php b/tests/functional/posting_test.php index 9bcfcc2fda..7fd1e4fdcf 100644 --- a/tests/functional/posting_test.php +++ b/tests/functional/posting_test.php @@ -32,105 +32,4 @@ class phpbb_functional_posting_test extends phpbb_functional_test_case $crawler = self::request('GET', "posting.php?mode=quote&f=2&t={$post2['topic_id']}&p={$post2['post_id']}&sid={$this->sid}"); $this->assertContains('This is a test post posted by the testing framework.', $crawler->filter('html')->text()); } - - /** - * Creates a topic - * - * Be sure to login before creating - * - * @param int $forum_id - * @param string $subject - * @param string $message - * @param array $additional_form_data Any additional form data to be sent in the request - * @return array post_id, topic_id - */ - public function create_topic($forum_id, $subject, $message, $additional_form_data = array()) - { - $posting_url = "posting.php?mode=post&f={$forum_id}&sid={$this->sid}"; - - $form_data = array_merge(array( - 'subject' => $subject, - 'message' => $message, - 'post' => true, - ), $additional_form_data); - - return self::submit_post($posting_url, 'POST_TOPIC', $form_data); - } - - /** - * Creates a post - * - * Be sure to login before creating - * - * @param int $forum_id - * @param string $subject - * @param string $message - * @param array $additional_form_data Any additional form data to be sent in the request - * @return array post_id, topic_id - */ - public function create_post($forum_id, $topic_id, $subject, $message, $additional_form_data = array()) - { - $posting_url = "posting.php?mode=reply&f={$forum_id}&t={$topic_id}&sid={$this->sid}"; - - $form_data = array_merge(array( - 'subject' => $subject, - 'message' => $message, - 'post' => true, - ), $additional_form_data); - - return self::submit_post($posting_url, 'POST_REPLY', $form_data); - } - - /** - * Helper for submitting posts - * - * @param string $posting_url - * @param string $posting_contains - * @param array $form_data - * @return array post_id, topic_id - */ - protected function submit_post($posting_url, $posting_contains, $form_data) - { - $this->add_lang('posting'); - - $crawler = self::request('GET', $posting_url); - $this->assertContains($this->lang($posting_contains), $crawler->filter('html')->text()); - - $hidden_fields = array( - $crawler->filter('[type="hidden"]')->each(function ($node, $i) { - return array('name' => $node->getAttribute('name'), 'value' => $node->getAttribute('value')); - }), - ); - - foreach ($hidden_fields as $fields) - { - foreach($fields as $field) - { - $form_data[$field['name']] = $field['value']; - } - } - - // Bypass time restriction that said that if the lastclick time (i.e. time when the form was opened) - // is not at least 2 seconds before submission, cancel the form - $form_data['lastclick'] = 0; - - // I use a request because the form submission method does not allow you to send data that is not - // contained in one of the actual form fields that the browser sees (i.e. it ignores "hidden" inputs) - // Instead, I send it as a request with the submit button "post" set to true. - $crawler = self::request('POST', $posting_url, $form_data); - $this->assertContains($this->lang('POST_STORED'), $crawler->filter('html')->text()); - - $url = $crawler->selectLink($this->lang('VIEW_MESSAGE', '', ''))->link()->getUri(); - - $matches = $topic_id = $post_id = false; - preg_match_all('#&t=([0-9]+)(&p=([0-9]+))?#', $url, $matches); - - $topic_id = (int) (isset($matches[1][0])) ? $matches[1][0] : 0; - $post_id = (int) (isset($matches[3][0])) ? $matches[3][0] : 0; - - return array( - 'topic_id' => $topic_id, - 'post_id' => $post_id, - ); - } } diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php index 684d7a84cb..15f7814800 100644 --- a/tests/test_framework/phpbb_functional_test_case.php +++ b/tests/test_framework/phpbb_functional_test_case.php @@ -593,4 +593,135 @@ class phpbb_functional_test_case extends phpbb_test_case { self::assertEquals($status_code, self::$client->getResponse()->getStatus()); } + + /** + * Creates a topic + * + * Be sure to login before creating + * + * @param int $forum_id + * @param string $subject + * @param string $message + * @param array $additional_form_data Any additional form data to be sent in the request + * @return array post_id, topic_id + */ + public function create_topic($forum_id, $subject, $message, $additional_form_data = array()) + { + $posting_url = "posting.php?mode=post&f={$forum_id}&sid={$this->sid}"; + + $form_data = array_merge(array( + 'subject' => $subject, + 'message' => $message, + 'post' => true, + ), $additional_form_data); + + return self::submit_post($posting_url, 'POST_TOPIC', $form_data); + } + + /** + * Creates a post + * + * Be sure to login before creating + * + * @param int $forum_id + * @param int $topic_id + * @param string $subject + * @param string $message + * @param array $additional_form_data Any additional form data to be sent in the request + * @return array post_id, topic_id + */ + public function create_post($forum_id, $topic_id, $subject, $message, $additional_form_data = array()) + { + $posting_url = "posting.php?mode=reply&f={$forum_id}&t={$topic_id}&sid={$this->sid}"; + + $form_data = array_merge(array( + 'subject' => $subject, + 'message' => $message, + 'post' => true, + ), $additional_form_data); + + return self::submit_post($posting_url, 'POST_REPLY', $form_data); + } + + /** + * Helper for submitting posts + * + * @param string $posting_url + * @param string $posting_contains + * @param array $form_data + * @return array post_id, topic_id + */ + protected function submit_post($posting_url, $posting_contains, $form_data) + { + $this->add_lang('posting'); + + $crawler = self::request('GET', $posting_url); + $this->assertContains($this->lang($posting_contains), $crawler->filter('html')->text()); + + $hidden_fields = array( + $crawler->filter('[type="hidden"]')->each(function ($node, $i) { + return array('name' => $node->getAttribute('name'), 'value' => $node->getAttribute('value')); + }), + ); + + foreach ($hidden_fields as $fields) + { + foreach($fields as $field) + { + $form_data[$field['name']] = $field['value']; + } + } + + // Bypass time restriction that said that if the lastclick time (i.e. time when the form was opened) + // is not at least 2 seconds before submission, cancel the form + $form_data['lastclick'] = 0; + + // I use a request because the form submission method does not allow you to send data that is not + // contained in one of the actual form fields that the browser sees (i.e. it ignores "hidden" inputs) + // Instead, I send it as a request with the submit button "post" set to true. + $crawler = self::request('POST', $posting_url, $form_data); + $this->assertContains($this->lang('POST_STORED'), $crawler->filter('html')->text()); + $url = $crawler->selectLink($this->lang('VIEW_MESSAGE', '', ''))->link()->getUri(); + + return array( + 'topic_id' => $this->get_parameter_from_link($url, 't'), + 'post_id' => $this->get_parameter_from_link($url, 'p'), + ); + } + + /* + * Returns the requested parameter from a URL + * + * @param string $url + * @param string $parameter + * @return string Value of the parameter in the URL, null if not set + */ + public function get_parameter_from_link($url, $parameter) + { + if (strpos($url, '?') === false) + { + return null; + } + + $url_parts = explode('?', $url); + if (isset($url_parts[1])) + { + $url_parameters = $url_parts[1]; + if (strpos($url_parameters, '#') !== false) + { + $url_parameters = explode('#', $url_parameters); + $url_parameters = $url_parameters[0]; + } + + foreach (explode('&', $url_parameters) as $url_param) + { + list($param, $value) = explode('=', $url_param); + if ($param == $parameter) + { + return $value; + } + } + } + return null; + } } -- cgit v1.2.1 From a9b5e77e684043924f8c34c8782b32a0f146228c Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 9 Aug 2013 00:41:28 +0200 Subject: [ticket/11775] Add functional test for moving the last post PHPBB3-11775 --- tests/functional/mcp_test.php | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 tests/functional/mcp_test.php (limited to 'tests') diff --git a/tests/functional/mcp_test.php b/tests/functional/mcp_test.php new file mode 100644 index 0000000000..f7e15de853 --- /dev/null +++ b/tests/functional/mcp_test.php @@ -0,0 +1,43 @@ +login(); + + // Test creating topic + $post = $this->create_topic(2, 'Test Topic 2', 'Testing move post with "Move posts" option from Quick-Moderator Tools.'); + + $crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}"); + $this->assertContains('Testing move post with "Move posts" option from Quick-Moderator Tools.', $crawler->filter('html')->text()); + + // Test moving a post + $this->add_lang('mcp'); + $form = $crawler->selectButton('Go')->eq(1)->form(); + $form['action']->select('merge'); + $crawler = self::submit($form); + + // Select the post in MCP + $form = $crawler->selectButton($this->lang('SUBMIT'))->form(array( + 'to_topic_id' => 1, + )); + $form['post_id_list'][0]->tick(); + $crawler = self::submit($form); + $this->assertContains($this->lang('MERGE_POSTS'), $crawler->filter('html')->text()); + + $form = $crawler->selectButton('Yes')->form(); + $crawler = self::submit($form); + $this->assertContains($this->lang('POSTS_MERGED_SUCCESS'), $crawler->text()); + } +} -- cgit v1.2.1 From e1c9a875867953f6bfd4e442ae804c85377f8360 Mon Sep 17 00:00:00 2001 From: rechosen Date: Thu, 8 Aug 2013 14:00:44 +0200 Subject: [ticket/11777] Move the testing template events to 'events/' subdirectories The tests written for extension template events did not follow the convention and documentation of placing template event files in the events/ subdirectory. Moved the files to this subdirectory so the tests succeed again. PHPBB3-11777 --- .../ext/kappa/styles/all/template/events/test.html | 1 + .../event_inheritance/ext/kappa/styles/all/template/test.html | 1 - .../ext/kappa/styles/silver/template/events/test.html | 1 + .../event_inheritance/ext/kappa/styles/silver/template/test.html | 1 - .../ext/kappa/styles/silver_inherit/template/events/test.html | 1 + .../ext/kappa/styles/silver_inherit/template/test.html | 1 - .../ext/omega/styles/all/template/events/test.html | 1 + .../event_inheritance/ext/omega/styles/all/template/test.html | 1 - .../ext/omega/styles/silver/template/events/test.html | 1 + .../ext/omega/styles/silver/template/events/two.html | 1 + .../event_inheritance/ext/omega/styles/silver/template/test.html | 1 - .../event_inheritance/ext/omega/styles/silver/template/two.html | 1 - .../event_inheritance/ext/zeta/styles/all/template/events/test.html | 1 + .../event_inheritance/ext/zeta/styles/all/template/test.html | 1 - .../ext/trivial/styles/all/template/event_variable_spacing.html | 6 ------ .../trivial/styles/all/template/events/event_variable_spacing.html | 6 ++++++ .../ext/trivial/styles/all/template/events/universal.html | 1 + .../ext_trivial/ext/trivial/styles/all/template/universal.html | 1 - .../ext/trivial/styles/silver/template/events/simple.html | 1 + .../ext_trivial/ext/trivial/styles/silver/template/simple.html | 1 - 20 files changed, 15 insertions(+), 15 deletions(-) create mode 100644 tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/events/test.html delete mode 100644 tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/test.html create mode 100644 tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/events/test.html delete mode 100644 tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/test.html create mode 100644 tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/events/test.html delete mode 100644 tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/test.html create mode 100644 tests/template/datasets/event_inheritance/ext/omega/styles/all/template/events/test.html delete mode 100644 tests/template/datasets/event_inheritance/ext/omega/styles/all/template/test.html create mode 100644 tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/events/test.html create mode 100644 tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/events/two.html delete mode 100644 tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/test.html delete mode 100644 tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/two.html create mode 100644 tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/events/test.html delete mode 100644 tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/test.html delete mode 100644 tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event_variable_spacing.html create mode 100644 tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/events/event_variable_spacing.html create mode 100644 tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/events/universal.html delete mode 100644 tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/universal.html create mode 100644 tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/events/simple.html delete mode 100644 tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/simple.html (limited to 'tests') diff --git a/tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/events/test.html b/tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/events/test.html new file mode 100644 index 0000000000..3eb906a09e --- /dev/null +++ b/tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/events/test.html @@ -0,0 +1 @@ +Kappa test event in all diff --git a/tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/test.html b/tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/test.html deleted file mode 100644 index 3eb906a09e..0000000000 --- a/tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/test.html +++ /dev/null @@ -1 +0,0 @@ -Kappa test event in all diff --git a/tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/events/test.html b/tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/events/test.html new file mode 100644 index 0000000000..3b65d80a6d --- /dev/null +++ b/tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/events/test.html @@ -0,0 +1 @@ +Kappa test event in silver diff --git a/tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/test.html b/tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/test.html deleted file mode 100644 index 3b65d80a6d..0000000000 --- a/tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/test.html +++ /dev/null @@ -1 +0,0 @@ -Kappa test event in silver diff --git a/tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/events/test.html b/tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/events/test.html new file mode 100644 index 0000000000..26826d59e3 --- /dev/null +++ b/tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/events/test.html @@ -0,0 +1 @@ +Kappa test event in silver_inherit diff --git a/tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/test.html b/tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/test.html deleted file mode 100644 index 26826d59e3..0000000000 --- a/tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/test.html +++ /dev/null @@ -1 +0,0 @@ -Kappa test event in silver_inherit diff --git a/tests/template/datasets/event_inheritance/ext/omega/styles/all/template/events/test.html b/tests/template/datasets/event_inheritance/ext/omega/styles/all/template/events/test.html new file mode 100644 index 0000000000..003d193dc3 --- /dev/null +++ b/tests/template/datasets/event_inheritance/ext/omega/styles/all/template/events/test.html @@ -0,0 +1 @@ +Omega test event in all diff --git a/tests/template/datasets/event_inheritance/ext/omega/styles/all/template/test.html b/tests/template/datasets/event_inheritance/ext/omega/styles/all/template/test.html deleted file mode 100644 index 003d193dc3..0000000000 --- a/tests/template/datasets/event_inheritance/ext/omega/styles/all/template/test.html +++ /dev/null @@ -1 +0,0 @@ -Omega test event in all diff --git a/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/events/test.html b/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/events/test.html new file mode 100644 index 0000000000..6bf06f5457 --- /dev/null +++ b/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/events/test.html @@ -0,0 +1 @@ +Omega test event in silver diff --git a/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/events/two.html b/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/events/two.html new file mode 100644 index 0000000000..7f8058f4e4 --- /dev/null +++ b/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/events/two.html @@ -0,0 +1 @@ +two in silver in omega diff --git a/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/test.html b/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/test.html deleted file mode 100644 index 6bf06f5457..0000000000 --- a/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/test.html +++ /dev/null @@ -1 +0,0 @@ -Omega test event in silver diff --git a/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/two.html b/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/two.html deleted file mode 100644 index 7f8058f4e4..0000000000 --- a/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/two.html +++ /dev/null @@ -1 +0,0 @@ -two in silver in omega diff --git a/tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/events/test.html b/tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/events/test.html new file mode 100644 index 0000000000..5fc7e5ac12 --- /dev/null +++ b/tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/events/test.html @@ -0,0 +1 @@ +Zeta test event in all diff --git a/tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/test.html b/tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/test.html deleted file mode 100644 index 5fc7e5ac12..0000000000 --- a/tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/test.html +++ /dev/null @@ -1 +0,0 @@ -Zeta test event in all diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event_variable_spacing.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event_variable_spacing.html deleted file mode 100644 index 028f8aa0d1..0000000000 --- a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event_variable_spacing.html +++ /dev/null @@ -1,6 +0,0 @@ -|{VARIABLE}| -{VARIABLE}|{VARIABLE}| - -|{VARIABLE} - -
test
diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/events/event_variable_spacing.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/events/event_variable_spacing.html new file mode 100644 index 0000000000..028f8aa0d1 --- /dev/null +++ b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/events/event_variable_spacing.html @@ -0,0 +1,6 @@ +|{VARIABLE}| +{VARIABLE}|{VARIABLE}| + +|{VARIABLE} + +
test
diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/events/universal.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/events/universal.html new file mode 100644 index 0000000000..f2c5762ade --- /dev/null +++ b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/events/universal.html @@ -0,0 +1 @@ +Universal in trivial extension. diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/universal.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/universal.html deleted file mode 100644 index f2c5762ade..0000000000 --- a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/universal.html +++ /dev/null @@ -1 +0,0 @@ -Universal in trivial extension. diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/events/simple.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/events/simple.html new file mode 100644 index 0000000000..fe32a1ed3f --- /dev/null +++ b/tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/events/simple.html @@ -0,0 +1 @@ +Simple in trivial extension. diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/simple.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/simple.html deleted file mode 100644 index fe32a1ed3f..0000000000 --- a/tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/simple.html +++ /dev/null @@ -1 +0,0 @@ -Simple in trivial extension. -- cgit v1.2.1 From 7f76c9f9c7d9014f313f150a9596bec030f39915 Mon Sep 17 00:00:00 2001 From: rechosen Date: Fri, 9 Aug 2013 11:33:24 +0200 Subject: [ticket/11777] Rename the extension template listener subdirectory to 'event/' Per suggestion of EXreaction and nickvergessen, do not look for extension template event listeners in styles/[style]/template/events/ but in styles/[style]/template/event/ (without the trailing 's') to match the way phpBB looks for php template event listeners. PHPBB3-11777 --- .../event_inheritance/ext/kappa/styles/all/template/event/test.html | 1 + .../ext/kappa/styles/all/template/events/test.html | 1 - .../ext/kappa/styles/silver/template/event/test.html | 1 + .../ext/kappa/styles/silver/template/events/test.html | 1 - .../ext/kappa/styles/silver_inherit/template/event/test.html | 1 + .../ext/kappa/styles/silver_inherit/template/events/test.html | 1 - .../event_inheritance/ext/omega/styles/all/template/event/test.html | 1 + .../ext/omega/styles/all/template/events/test.html | 1 - .../ext/omega/styles/silver/template/event/test.html | 1 + .../ext/omega/styles/silver/template/event/two.html | 1 + .../ext/omega/styles/silver/template/events/test.html | 1 - .../ext/omega/styles/silver/template/events/two.html | 1 - .../event_inheritance/ext/zeta/styles/all/template/event/test.html | 1 + .../event_inheritance/ext/zeta/styles/all/template/events/test.html | 1 - .../trivial/styles/all/template/event/event_variable_spacing.html | 6 ++++++ .../ext/trivial/styles/all/template/event/universal.html | 1 + .../trivial/styles/all/template/events/event_variable_spacing.html | 6 ------ .../ext/trivial/styles/all/template/events/universal.html | 1 - .../ext/trivial/styles/silver/template/event/simple.html | 1 + .../ext/trivial/styles/silver/template/events/simple.html | 1 - 20 files changed, 15 insertions(+), 15 deletions(-) create mode 100644 tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/event/test.html delete mode 100644 tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/events/test.html create mode 100644 tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/event/test.html delete mode 100644 tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/events/test.html create mode 100644 tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/event/test.html delete mode 100644 tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/events/test.html create mode 100644 tests/template/datasets/event_inheritance/ext/omega/styles/all/template/event/test.html delete mode 100644 tests/template/datasets/event_inheritance/ext/omega/styles/all/template/events/test.html create mode 100644 tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/test.html create mode 100644 tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/two.html delete mode 100644 tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/events/test.html delete mode 100644 tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/events/two.html create mode 100644 tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/event/test.html delete mode 100644 tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/events/test.html create mode 100644 tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/event_variable_spacing.html create mode 100644 tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/universal.html delete mode 100644 tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/events/event_variable_spacing.html delete mode 100644 tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/events/universal.html create mode 100644 tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/event/simple.html delete mode 100644 tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/events/simple.html (limited to 'tests') diff --git a/tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/event/test.html b/tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/event/test.html new file mode 100644 index 0000000000..3eb906a09e --- /dev/null +++ b/tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/event/test.html @@ -0,0 +1 @@ +Kappa test event in all diff --git a/tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/events/test.html b/tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/events/test.html deleted file mode 100644 index 3eb906a09e..0000000000 --- a/tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/events/test.html +++ /dev/null @@ -1 +0,0 @@ -Kappa test event in all diff --git a/tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/event/test.html b/tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/event/test.html new file mode 100644 index 0000000000..3b65d80a6d --- /dev/null +++ b/tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/event/test.html @@ -0,0 +1 @@ +Kappa test event in silver diff --git a/tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/events/test.html b/tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/events/test.html deleted file mode 100644 index 3b65d80a6d..0000000000 --- a/tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/events/test.html +++ /dev/null @@ -1 +0,0 @@ -Kappa test event in silver diff --git a/tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/event/test.html b/tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/event/test.html new file mode 100644 index 0000000000..26826d59e3 --- /dev/null +++ b/tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/event/test.html @@ -0,0 +1 @@ +Kappa test event in silver_inherit diff --git a/tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/events/test.html b/tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/events/test.html deleted file mode 100644 index 26826d59e3..0000000000 --- a/tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/events/test.html +++ /dev/null @@ -1 +0,0 @@ -Kappa test event in silver_inherit diff --git a/tests/template/datasets/event_inheritance/ext/omega/styles/all/template/event/test.html b/tests/template/datasets/event_inheritance/ext/omega/styles/all/template/event/test.html new file mode 100644 index 0000000000..003d193dc3 --- /dev/null +++ b/tests/template/datasets/event_inheritance/ext/omega/styles/all/template/event/test.html @@ -0,0 +1 @@ +Omega test event in all diff --git a/tests/template/datasets/event_inheritance/ext/omega/styles/all/template/events/test.html b/tests/template/datasets/event_inheritance/ext/omega/styles/all/template/events/test.html deleted file mode 100644 index 003d193dc3..0000000000 --- a/tests/template/datasets/event_inheritance/ext/omega/styles/all/template/events/test.html +++ /dev/null @@ -1 +0,0 @@ -Omega test event in all diff --git a/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/test.html b/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/test.html new file mode 100644 index 0000000000..6bf06f5457 --- /dev/null +++ b/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/test.html @@ -0,0 +1 @@ +Omega test event in silver diff --git a/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/two.html b/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/two.html new file mode 100644 index 0000000000..7f8058f4e4 --- /dev/null +++ b/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/two.html @@ -0,0 +1 @@ +two in silver in omega diff --git a/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/events/test.html b/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/events/test.html deleted file mode 100644 index 6bf06f5457..0000000000 --- a/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/events/test.html +++ /dev/null @@ -1 +0,0 @@ -Omega test event in silver diff --git a/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/events/two.html b/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/events/two.html deleted file mode 100644 index 7f8058f4e4..0000000000 --- a/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/events/two.html +++ /dev/null @@ -1 +0,0 @@ -two in silver in omega diff --git a/tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/event/test.html b/tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/event/test.html new file mode 100644 index 0000000000..5fc7e5ac12 --- /dev/null +++ b/tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/event/test.html @@ -0,0 +1 @@ +Zeta test event in all diff --git a/tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/events/test.html b/tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/events/test.html deleted file mode 100644 index 5fc7e5ac12..0000000000 --- a/tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/events/test.html +++ /dev/null @@ -1 +0,0 @@ -Zeta test event in all diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/event_variable_spacing.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/event_variable_spacing.html new file mode 100644 index 0000000000..028f8aa0d1 --- /dev/null +++ b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/event_variable_spacing.html @@ -0,0 +1,6 @@ +|{VARIABLE}| +{VARIABLE}|{VARIABLE}| + +|{VARIABLE} + +
test
diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/universal.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/universal.html new file mode 100644 index 0000000000..f2c5762ade --- /dev/null +++ b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/universal.html @@ -0,0 +1 @@ +Universal in trivial extension. diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/events/event_variable_spacing.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/events/event_variable_spacing.html deleted file mode 100644 index 028f8aa0d1..0000000000 --- a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/events/event_variable_spacing.html +++ /dev/null @@ -1,6 +0,0 @@ -|{VARIABLE}| -{VARIABLE}|{VARIABLE}| - -|{VARIABLE} - -
test
diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/events/universal.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/events/universal.html deleted file mode 100644 index f2c5762ade..0000000000 --- a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/events/universal.html +++ /dev/null @@ -1 +0,0 @@ -Universal in trivial extension. diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/event/simple.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/event/simple.html new file mode 100644 index 0000000000..fe32a1ed3f --- /dev/null +++ b/tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/event/simple.html @@ -0,0 +1 @@ +Simple in trivial extension. diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/events/simple.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/events/simple.html deleted file mode 100644 index fe32a1ed3f..0000000000 --- a/tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/events/simple.html +++ /dev/null @@ -1 +0,0 @@ -Simple in trivial extension. -- cgit v1.2.1 From 08e6c6118036700f5d4196aa09d9d1a34b840514 Mon Sep 17 00:00:00 2001 From: rechosen Date: Fri, 9 Aug 2013 11:39:43 +0200 Subject: [ticket/11777] Require a suffix of '_listener' on extension template listeners To further mirror the file name and location requirements for php template event listeners, require extension template event listener files to follow the '_listener.html' naming format. PHPBB3-11777 --- .../event_inheritance/ext/kappa/styles/all/template/event/test.html | 1 - .../ext/kappa/styles/all/template/event/test_listener.html | 1 + .../ext/kappa/styles/silver/template/event/test.html | 1 - .../ext/kappa/styles/silver/template/event/test_listener.html | 1 + .../ext/kappa/styles/silver_inherit/template/event/test.html | 1 - .../kappa/styles/silver_inherit/template/event/test_listener.html | 1 + .../event_inheritance/ext/omega/styles/all/template/event/test.html | 1 - .../ext/omega/styles/all/template/event/test_listener.html | 1 + .../ext/omega/styles/silver/template/event/test.html | 1 - .../ext/omega/styles/silver/template/event/test_listener.html | 1 + .../ext/omega/styles/silver/template/event/two.html | 1 - .../ext/omega/styles/silver/template/event/two_listener.html | 1 + .../event_inheritance/ext/zeta/styles/all/template/event/test.html | 1 - .../ext/zeta/styles/all/template/event/test_listener.html | 1 + .../trivial/styles/all/template/event/event_variable_spacing.html | 6 ------ .../styles/all/template/event/event_variable_spacing_listener.html | 6 ++++++ .../ext/trivial/styles/all/template/event/universal.html | 1 - .../ext/trivial/styles/all/template/event/universal_listener.html | 1 + .../ext/trivial/styles/silver/template/event/simple.html | 1 - .../ext/trivial/styles/silver/template/event/simple_listener.html | 1 + 20 files changed, 15 insertions(+), 15 deletions(-) delete mode 100644 tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/event/test.html create mode 100644 tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/event/test_listener.html delete mode 100644 tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/event/test.html create mode 100644 tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/event/test_listener.html delete mode 100644 tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/event/test.html create mode 100644 tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/event/test_listener.html delete mode 100644 tests/template/datasets/event_inheritance/ext/omega/styles/all/template/event/test.html create mode 100644 tests/template/datasets/event_inheritance/ext/omega/styles/all/template/event/test_listener.html delete mode 100644 tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/test.html create mode 100644 tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/test_listener.html delete mode 100644 tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/two.html create mode 100644 tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/two_listener.html delete mode 100644 tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/event/test.html create mode 100644 tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/event/test_listener.html delete mode 100644 tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/event_variable_spacing.html create mode 100644 tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/event_variable_spacing_listener.html delete mode 100644 tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/universal.html create mode 100644 tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/universal_listener.html delete mode 100644 tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/event/simple.html create mode 100644 tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/event/simple_listener.html (limited to 'tests') diff --git a/tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/event/test.html b/tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/event/test.html deleted file mode 100644 index 3eb906a09e..0000000000 --- a/tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/event/test.html +++ /dev/null @@ -1 +0,0 @@ -Kappa test event in all diff --git a/tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/event/test_listener.html b/tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/event/test_listener.html new file mode 100644 index 0000000000..3eb906a09e --- /dev/null +++ b/tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/event/test_listener.html @@ -0,0 +1 @@ +Kappa test event in all diff --git a/tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/event/test.html b/tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/event/test.html deleted file mode 100644 index 3b65d80a6d..0000000000 --- a/tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/event/test.html +++ /dev/null @@ -1 +0,0 @@ -Kappa test event in silver diff --git a/tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/event/test_listener.html b/tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/event/test_listener.html new file mode 100644 index 0000000000..3b65d80a6d --- /dev/null +++ b/tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/event/test_listener.html @@ -0,0 +1 @@ +Kappa test event in silver diff --git a/tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/event/test.html b/tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/event/test.html deleted file mode 100644 index 26826d59e3..0000000000 --- a/tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/event/test.html +++ /dev/null @@ -1 +0,0 @@ -Kappa test event in silver_inherit diff --git a/tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/event/test_listener.html b/tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/event/test_listener.html new file mode 100644 index 0000000000..26826d59e3 --- /dev/null +++ b/tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/event/test_listener.html @@ -0,0 +1 @@ +Kappa test event in silver_inherit diff --git a/tests/template/datasets/event_inheritance/ext/omega/styles/all/template/event/test.html b/tests/template/datasets/event_inheritance/ext/omega/styles/all/template/event/test.html deleted file mode 100644 index 003d193dc3..0000000000 --- a/tests/template/datasets/event_inheritance/ext/omega/styles/all/template/event/test.html +++ /dev/null @@ -1 +0,0 @@ -Omega test event in all diff --git a/tests/template/datasets/event_inheritance/ext/omega/styles/all/template/event/test_listener.html b/tests/template/datasets/event_inheritance/ext/omega/styles/all/template/event/test_listener.html new file mode 100644 index 0000000000..003d193dc3 --- /dev/null +++ b/tests/template/datasets/event_inheritance/ext/omega/styles/all/template/event/test_listener.html @@ -0,0 +1 @@ +Omega test event in all diff --git a/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/test.html b/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/test.html deleted file mode 100644 index 6bf06f5457..0000000000 --- a/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/test.html +++ /dev/null @@ -1 +0,0 @@ -Omega test event in silver diff --git a/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/test_listener.html b/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/test_listener.html new file mode 100644 index 0000000000..6bf06f5457 --- /dev/null +++ b/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/test_listener.html @@ -0,0 +1 @@ +Omega test event in silver diff --git a/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/two.html b/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/two.html deleted file mode 100644 index 7f8058f4e4..0000000000 --- a/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/two.html +++ /dev/null @@ -1 +0,0 @@ -two in silver in omega diff --git a/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/two_listener.html b/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/two_listener.html new file mode 100644 index 0000000000..7f8058f4e4 --- /dev/null +++ b/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/two_listener.html @@ -0,0 +1 @@ +two in silver in omega diff --git a/tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/event/test.html b/tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/event/test.html deleted file mode 100644 index 5fc7e5ac12..0000000000 --- a/tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/event/test.html +++ /dev/null @@ -1 +0,0 @@ -Zeta test event in all diff --git a/tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/event/test_listener.html b/tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/event/test_listener.html new file mode 100644 index 0000000000..5fc7e5ac12 --- /dev/null +++ b/tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/event/test_listener.html @@ -0,0 +1 @@ +Zeta test event in all diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/event_variable_spacing.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/event_variable_spacing.html deleted file mode 100644 index 028f8aa0d1..0000000000 --- a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/event_variable_spacing.html +++ /dev/null @@ -1,6 +0,0 @@ -|{VARIABLE}| -{VARIABLE}|{VARIABLE}| - -|{VARIABLE} - -
test
diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/event_variable_spacing_listener.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/event_variable_spacing_listener.html new file mode 100644 index 0000000000..028f8aa0d1 --- /dev/null +++ b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/event_variable_spacing_listener.html @@ -0,0 +1,6 @@ +|{VARIABLE}| +{VARIABLE}|{VARIABLE}| + +|{VARIABLE} + +
test
diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/universal.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/universal.html deleted file mode 100644 index f2c5762ade..0000000000 --- a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/universal.html +++ /dev/null @@ -1 +0,0 @@ -Universal in trivial extension. diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/universal_listener.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/universal_listener.html new file mode 100644 index 0000000000..f2c5762ade --- /dev/null +++ b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/universal_listener.html @@ -0,0 +1 @@ +Universal in trivial extension. diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/event/simple.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/event/simple.html deleted file mode 100644 index fe32a1ed3f..0000000000 --- a/tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/event/simple.html +++ /dev/null @@ -1 +0,0 @@ -Simple in trivial extension. diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/event/simple_listener.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/event/simple_listener.html new file mode 100644 index 0000000000..fe32a1ed3f --- /dev/null +++ b/tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/event/simple_listener.html @@ -0,0 +1 @@ +Simple in trivial extension. -- cgit v1.2.1 From 4b1c5879eb64006c57d94bf534d4a382d9ba5c41 Mon Sep 17 00:00:00 2001 From: rechosen Date: Mon, 12 Aug 2013 10:21:40 +0200 Subject: [ticket/11777] Fix new test for loop variables in extension template listeners With the merge of https://github.com/phpbb/phpbb3/pull/1564 a new test has been added. Renamed and moved the template listener file of that test to comply with the new requirements. PHPBB3-11777 --- .../ext/trivial/styles/all/template/event/test_event_loop_listener.html | 1 + .../ext_trivial/ext/trivial/styles/all/template/test_event_loop.html | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_loop_listener.html delete mode 100644 tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/test_event_loop.html (limited to 'tests') diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_loop_listener.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_loop_listener.html new file mode 100644 index 0000000000..235e129f85 --- /dev/null +++ b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_loop_listener.html @@ -0,0 +1 @@ +{event_loop.S_ROW_COUNT}| diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/test_event_loop.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/test_event_loop.html deleted file mode 100644 index 235e129f85..0000000000 --- a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/test_event_loop.html +++ /dev/null @@ -1 +0,0 @@ -{event_loop.S_ROW_COUNT}| -- cgit v1.2.1 From 63535b196dd5d4dcdc9a8fb6af03663638f8d8ce Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 12 Aug 2013 15:31:19 +0200 Subject: [ticket/11775] Split test into multiple steps PHPBB3-11775 --- tests/functional/mcp_test.php | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/functional/mcp_test.php b/tests/functional/mcp_test.php index f7e15de853..f65a7d0784 100644 --- a/tests/functional/mcp_test.php +++ b/tests/functional/mcp_test.php @@ -22,12 +22,27 @@ class phpbb_functional_mcp_test extends phpbb_functional_test_case $crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}"); $this->assertContains('Testing move post with "Move posts" option from Quick-Moderator Tools.', $crawler->filter('html')->text()); + return $crawler; + } + + /** + * @depends test_post_new_topic + */ + public function test_handle_quickmod($crawler) + { // Test moving a post - $this->add_lang('mcp'); $form = $crawler->selectButton('Go')->eq(1)->form(); $form['action']->select('merge'); $crawler = self::submit($form); + return $crawler; + } + + /** + * @depends test_handle_quickmod + */ + public function test_move_post_to_topic($crawler) + { // Select the post in MCP $form = $crawler->selectButton($this->lang('SUBMIT'))->form(array( 'to_topic_id' => 1, @@ -36,6 +51,15 @@ class phpbb_functional_mcp_test extends phpbb_functional_test_case $crawler = self::submit($form); $this->assertContains($this->lang('MERGE_POSTS'), $crawler->filter('html')->text()); + return $crawler; + } + + /** + * @depends test_move_post_to_topic + */ + public function test_confirm_result($crawler) + { + $this->add_lang('mcp'); $form = $crawler->selectButton('Yes')->form(); $crawler = self::submit($form); $this->assertContains($this->lang('POSTS_MERGED_SUCCESS'), $crawler->text()); -- cgit v1.2.1 From 65d8cd63022d688fe618f128768b78a6214db166 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Tue, 13 Aug 2013 02:14:22 -0700 Subject: [ticket/11784] Remove naming redundancy for event listeners PHPBB3-11784 --- .../fixtures/ext/foo/bar/event/permission.php | 40 ++++++++++++++++++++++ .../ext/foo/bar/event/permission_listener.php | 40 ---------------------- .../ext/kappa/styles/all/template/event/test.html | 1 + .../styles/all/template/event/test_listener.html | 1 - .../kappa/styles/silver/template/event/test.html | 1 + .../silver/template/event/test_listener.html | 1 - .../styles/silver_inherit/template/event/test.html | 1 + .../template/event/test_listener.html | 1 - .../ext/omega/styles/all/template/event/test.html | 1 + .../styles/all/template/event/test_listener.html | 1 - .../omega/styles/silver/template/event/test.html | 1 + .../silver/template/event/test_listener.html | 1 - .../omega/styles/silver/template/event/two.html | 1 + .../styles/silver/template/event/two_listener.html | 1 - .../ext/zeta/styles/all/template/event/test.html | 1 + .../styles/all/template/event/test_listener.html | 1 - .../all/template/event/event_variable_spacing.html | 6 ++++ .../event/event_variable_spacing_listener.html | 6 ---- .../styles/all/template/event/test_event_loop.html | 1 + .../template/event/test_event_loop_listener.html | 1 - .../styles/all/template/event/universal.html | 1 + .../all/template/event/universal_listener.html | 1 - .../styles/silver/template/event/simple.html | 1 + .../silver/template/event/simple_listener.html | 1 - 24 files changed, 56 insertions(+), 56 deletions(-) create mode 100644 tests/functional/fixtures/ext/foo/bar/event/permission.php delete mode 100644 tests/functional/fixtures/ext/foo/bar/event/permission_listener.php create mode 100644 tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/event/test.html delete mode 100644 tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/event/test_listener.html create mode 100644 tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/event/test.html delete mode 100644 tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/event/test_listener.html create mode 100644 tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/event/test.html delete mode 100644 tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/event/test_listener.html create mode 100644 tests/template/datasets/event_inheritance/ext/omega/styles/all/template/event/test.html delete mode 100644 tests/template/datasets/event_inheritance/ext/omega/styles/all/template/event/test_listener.html create mode 100644 tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/test.html delete mode 100644 tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/test_listener.html create mode 100644 tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/two.html delete mode 100644 tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/two_listener.html create mode 100644 tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/event/test.html delete mode 100644 tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/event/test_listener.html create mode 100644 tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/event_variable_spacing.html delete mode 100644 tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/event_variable_spacing_listener.html create mode 100644 tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_loop.html delete mode 100644 tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_loop_listener.html create mode 100644 tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/universal.html delete mode 100644 tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/universal_listener.html create mode 100644 tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/event/simple.html delete mode 100644 tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/event/simple_listener.html (limited to 'tests') diff --git a/tests/functional/fixtures/ext/foo/bar/event/permission.php b/tests/functional/fixtures/ext/foo/bar/event/permission.php new file mode 100644 index 0000000000..48688a586a --- /dev/null +++ b/tests/functional/fixtures/ext/foo/bar/event/permission.php @@ -0,0 +1,40 @@ + 'add_permissions', + ); + } + + public function add_permissions($event) + { + $permissions = $event['permissions']; + $permissions['u_foo'] = array('lang' => 'ACL_U_FOOBAR', 'cat' => 'post'); + $event['permissions'] = $permissions; + } +} diff --git a/tests/functional/fixtures/ext/foo/bar/event/permission_listener.php b/tests/functional/fixtures/ext/foo/bar/event/permission_listener.php deleted file mode 100644 index 6986755f71..0000000000 --- a/tests/functional/fixtures/ext/foo/bar/event/permission_listener.php +++ /dev/null @@ -1,40 +0,0 @@ - 'add_permissions', - ); - } - - public function add_permissions($event) - { - $permissions = $event['permissions']; - $permissions['u_foo'] = array('lang' => 'ACL_U_FOOBAR', 'cat' => 'post'); - $event['permissions'] = $permissions; - } -} diff --git a/tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/event/test.html b/tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/event/test.html new file mode 100644 index 0000000000..3eb906a09e --- /dev/null +++ b/tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/event/test.html @@ -0,0 +1 @@ +Kappa test event in all diff --git a/tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/event/test_listener.html b/tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/event/test_listener.html deleted file mode 100644 index 3eb906a09e..0000000000 --- a/tests/template/datasets/event_inheritance/ext/kappa/styles/all/template/event/test_listener.html +++ /dev/null @@ -1 +0,0 @@ -Kappa test event in all diff --git a/tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/event/test.html b/tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/event/test.html new file mode 100644 index 0000000000..3b65d80a6d --- /dev/null +++ b/tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/event/test.html @@ -0,0 +1 @@ +Kappa test event in silver diff --git a/tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/event/test_listener.html b/tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/event/test_listener.html deleted file mode 100644 index 3b65d80a6d..0000000000 --- a/tests/template/datasets/event_inheritance/ext/kappa/styles/silver/template/event/test_listener.html +++ /dev/null @@ -1 +0,0 @@ -Kappa test event in silver diff --git a/tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/event/test.html b/tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/event/test.html new file mode 100644 index 0000000000..26826d59e3 --- /dev/null +++ b/tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/event/test.html @@ -0,0 +1 @@ +Kappa test event in silver_inherit diff --git a/tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/event/test_listener.html b/tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/event/test_listener.html deleted file mode 100644 index 26826d59e3..0000000000 --- a/tests/template/datasets/event_inheritance/ext/kappa/styles/silver_inherit/template/event/test_listener.html +++ /dev/null @@ -1 +0,0 @@ -Kappa test event in silver_inherit diff --git a/tests/template/datasets/event_inheritance/ext/omega/styles/all/template/event/test.html b/tests/template/datasets/event_inheritance/ext/omega/styles/all/template/event/test.html new file mode 100644 index 0000000000..003d193dc3 --- /dev/null +++ b/tests/template/datasets/event_inheritance/ext/omega/styles/all/template/event/test.html @@ -0,0 +1 @@ +Omega test event in all diff --git a/tests/template/datasets/event_inheritance/ext/omega/styles/all/template/event/test_listener.html b/tests/template/datasets/event_inheritance/ext/omega/styles/all/template/event/test_listener.html deleted file mode 100644 index 003d193dc3..0000000000 --- a/tests/template/datasets/event_inheritance/ext/omega/styles/all/template/event/test_listener.html +++ /dev/null @@ -1 +0,0 @@ -Omega test event in all diff --git a/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/test.html b/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/test.html new file mode 100644 index 0000000000..6bf06f5457 --- /dev/null +++ b/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/test.html @@ -0,0 +1 @@ +Omega test event in silver diff --git a/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/test_listener.html b/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/test_listener.html deleted file mode 100644 index 6bf06f5457..0000000000 --- a/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/test_listener.html +++ /dev/null @@ -1 +0,0 @@ -Omega test event in silver diff --git a/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/two.html b/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/two.html new file mode 100644 index 0000000000..7f8058f4e4 --- /dev/null +++ b/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/two.html @@ -0,0 +1 @@ +two in silver in omega diff --git a/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/two_listener.html b/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/two_listener.html deleted file mode 100644 index 7f8058f4e4..0000000000 --- a/tests/template/datasets/event_inheritance/ext/omega/styles/silver/template/event/two_listener.html +++ /dev/null @@ -1 +0,0 @@ -two in silver in omega diff --git a/tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/event/test.html b/tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/event/test.html new file mode 100644 index 0000000000..5fc7e5ac12 --- /dev/null +++ b/tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/event/test.html @@ -0,0 +1 @@ +Zeta test event in all diff --git a/tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/event/test_listener.html b/tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/event/test_listener.html deleted file mode 100644 index 5fc7e5ac12..0000000000 --- a/tests/template/datasets/event_inheritance/ext/zeta/styles/all/template/event/test_listener.html +++ /dev/null @@ -1 +0,0 @@ -Zeta test event in all diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/event_variable_spacing.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/event_variable_spacing.html new file mode 100644 index 0000000000..028f8aa0d1 --- /dev/null +++ b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/event_variable_spacing.html @@ -0,0 +1,6 @@ +|{VARIABLE}| +{VARIABLE}|{VARIABLE}| + +|{VARIABLE} + +
test
diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/event_variable_spacing_listener.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/event_variable_spacing_listener.html deleted file mode 100644 index 028f8aa0d1..0000000000 --- a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/event_variable_spacing_listener.html +++ /dev/null @@ -1,6 +0,0 @@ -|{VARIABLE}| -{VARIABLE}|{VARIABLE}| - -|{VARIABLE} - -
test
diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_loop.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_loop.html new file mode 100644 index 0000000000..235e129f85 --- /dev/null +++ b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_loop.html @@ -0,0 +1 @@ +{event_loop.S_ROW_COUNT}| diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_loop_listener.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_loop_listener.html deleted file mode 100644 index 235e129f85..0000000000 --- a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_loop_listener.html +++ /dev/null @@ -1 +0,0 @@ -{event_loop.S_ROW_COUNT}| diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/universal.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/universal.html new file mode 100644 index 0000000000..f2c5762ade --- /dev/null +++ b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/universal.html @@ -0,0 +1 @@ +Universal in trivial extension. diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/universal_listener.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/universal_listener.html deleted file mode 100644 index f2c5762ade..0000000000 --- a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/universal_listener.html +++ /dev/null @@ -1 +0,0 @@ -Universal in trivial extension. diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/event/simple.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/event/simple.html new file mode 100644 index 0000000000..fe32a1ed3f --- /dev/null +++ b/tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/event/simple.html @@ -0,0 +1 @@ +Simple in trivial extension. diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/event/simple_listener.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/event/simple_listener.html deleted file mode 100644 index fe32a1ed3f..0000000000 --- a/tests/template/datasets/ext_trivial/ext/trivial/styles/silver/template/event/simple_listener.html +++ /dev/null @@ -1 +0,0 @@ -Simple in trivial extension. -- cgit v1.2.1 From 4b0adfcff54f9ebd3261e4673f689eb2c4c066df Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 15 Aug 2013 01:35:02 +0200 Subject: [ticket/11775] Remove spaces at line ends PHPBB3-11775 --- tests/test_framework/phpbb_functional_test_case.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php index 15f7814800..72990d3a21 100644 --- a/tests/test_framework/phpbb_functional_test_case.php +++ b/tests/test_framework/phpbb_functional_test_case.php @@ -596,9 +596,9 @@ class phpbb_functional_test_case extends phpbb_test_case /** * Creates a topic - * + * * Be sure to login before creating - * + * * @param int $forum_id * @param string $subject * @param string $message @@ -620,9 +620,9 @@ class phpbb_functional_test_case extends phpbb_test_case /** * Creates a post - * + * * Be sure to login before creating - * + * * @param int $forum_id * @param int $topic_id * @param string $subject -- cgit v1.2.1 From c30d4025d2976db3f55a8d477e27ca5598f83f69 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 15 Aug 2013 01:36:38 +0200 Subject: [ticket/11775] Fix doc blocks syntax PHPBB3-11775 --- tests/test_framework/phpbb_functional_test_case.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php index 72990d3a21..7d8b4a3144 100644 --- a/tests/test_framework/phpbb_functional_test_case.php +++ b/tests/test_framework/phpbb_functional_test_case.php @@ -689,7 +689,7 @@ class phpbb_functional_test_case extends phpbb_test_case ); } - /* + /** * Returns the requested parameter from a URL * * @param string $url -- cgit v1.2.1 From e113b468101a24fbc02157e1ada0d7ead5ccf1ae Mon Sep 17 00:00:00 2001 From: rechosen Date: Thu, 22 Aug 2013 11:06:04 +0200 Subject: [ticket/11792] Add functional test for var lang_set_ext of core.user_setup To ensure that the new lang_set_ext variable available with the core.user_setup event works properly, a functional test was added. It overwrites the value of the 'SKIP' language key, which is assumed to remain in use for some time to come. PHPBB3-11792 --- tests/functional/extension_global_lang_test.php | 63 ++++++++++++++++++++++ .../fixtures/ext/foo/bar/event/user_setup.php | 43 +++++++++++++++ .../ext/foo/bar/language/en/foo_global.php | 5 ++ 3 files changed, 111 insertions(+) create mode 100644 tests/functional/extension_global_lang_test.php create mode 100644 tests/functional/fixtures/ext/foo/bar/event/user_setup.php create mode 100644 tests/functional/fixtures/ext/foo/bar/language/en/foo_global.php (limited to 'tests') diff --git a/tests/functional/extension_global_lang_test.php b/tests/functional/extension_global_lang_test.php new file mode 100644 index 0000000000..fb8f87e6de --- /dev/null +++ b/tests/functional/extension_global_lang_test.php @@ -0,0 +1,63 @@ +copy_ext_fixtures(dirname(__FILE__) . '/fixtures/ext/', self::$fixtures); + } + + static public function tearDownAfterClass() + { + parent::tearDownAfterClass(); + + self::$helper->restore_original_ext_dir(); + } + + public function setUp() + { + parent::setUp(); + + $this->get_db(); + + $this->phpbb_extension_manager = $this->get_extension_manager(); + + $this->purge_cache(); + } + + public function test_load_extension_lang_globally() + { + $this->phpbb_extension_manager->enable('foo/bar'); + + // The board index, which should contain an overwritten translation + $crawler = self::request('GET', 'index.php'); + + // language from language/en/common.php + $this->assertNotContains('Skip to content', $crawler->filter('.skiplink')->text()); + + // language from ext/foo/bar/language/en/foo_global.php + $this->assertContains('Overwritten by foo', $crawler->filter('.skiplink')->text()); + } +} diff --git a/tests/functional/fixtures/ext/foo/bar/event/user_setup.php b/tests/functional/fixtures/ext/foo/bar/event/user_setup.php new file mode 100644 index 0000000000..3d2d0c5325 --- /dev/null +++ b/tests/functional/fixtures/ext/foo/bar/event/user_setup.php @@ -0,0 +1,43 @@ + 'add_global_translations', + ); + } + + public function add_global_translations($event) + { + $lang_set_ext = $event['lang_set_ext']; + $lang_set_ext[] = array( + 'ext_name' => 'foo/bar', + 'lang_set' => 'foo_global', + ); + $event['lang_set_ext'] = $lang_set_ext; + } +} diff --git a/tests/functional/fixtures/ext/foo/bar/language/en/foo_global.php b/tests/functional/fixtures/ext/foo/bar/language/en/foo_global.php new file mode 100644 index 0000000000..a6af8680d3 --- /dev/null +++ b/tests/functional/fixtures/ext/foo/bar/language/en/foo_global.php @@ -0,0 +1,5 @@ + 'Overwritten by foo', +)); -- cgit v1.2.1