From 5d3f0cd482bf643241186d94a545d37f702f6f13 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Tue, 20 May 2025 20:59:40 +0200 Subject: [PATCH] [ticket/17514] Replace phpBB3 with phpBB in tests PHPBB-17514 --- tests/RUNNING_TESTS.md | 4 +-- tests/controller/helper_route_slash_test.php | 6 ++--- tests/event/php_exporter_test.php | 4 +-- tests/functional/notification_test.php | 2 +- tests/functional/search/base.php | 8 +++--- tests/path_helper/path_helper_test.php | 28 ++++++++++---------- tests/regex/table_prefix_test.php | 2 +- tests/ucp/controller_webpush_test.php | 6 ++--- tests/ucp/fixtures/webpush.xml | 4 +-- 9 files changed, 32 insertions(+), 32 deletions(-) diff --git a/tests/RUNNING_TESTS.md b/tests/RUNNING_TESTS.md index 81d7516c0b..b047199e38 100644 --- a/tests/RUNNING_TESTS.md +++ b/tests/RUNNING_TESTS.md @@ -165,7 +165,7 @@ phpBB allows you to write such tests. Running ------- -Running the tests requires your phpBB3 repository to be accessible through a +Running the tests requires your phpBB repository to be accessible through a local web server. You will need to supply the URL to the webserver in the 'tests/test_config.php' file. This is as simple as defining the '$phpbb_functional_url' variable, which contains the URL for the directory containing @@ -173,7 +173,7 @@ the board. Make sure you include the trailing slash. Note that without extensive changes to the test framework, you cannot use a board outside of the repository on which to run tests. - $phpbb_functional_url = 'http://localhost/phpBB3/'; + $phpbb_functional_url = 'http://localhost/phpBB/'; Functional tests are automatically run, if '$phpbb_functional_url' is configured. If you only want the functional tests, run: diff --git a/tests/controller/helper_route_slash_test.php b/tests/controller/helper_route_slash_test.php index 3b3d66bb9e..5a37d3220f 100644 --- a/tests/controller/helper_route_slash_test.php +++ b/tests/controller/helper_route_slash_test.php @@ -22,12 +22,12 @@ class phpbb_controller_helper_route_slash_test extends phpbb_controller_common_h protected function get_uri() { - return '/phpBB3/app.php'; + return '/phpBB/app.php'; } protected function get_base_uri() { - return '/phpBB3/'; + return '/phpBB/'; } protected function get_script_name() @@ -37,6 +37,6 @@ class phpbb_controller_helper_route_slash_test extends phpbb_controller_common_h protected function path_to_app() { - return 'phpBB3/'; + return 'phpBB/'; } } diff --git a/tests/event/php_exporter_test.php b/tests/event/php_exporter_test.php index 3911f46ddd..f7b244544e 100644 --- a/tests/event/php_exporter_test.php +++ b/tests/event/php_exporter_test.php @@ -352,11 +352,11 @@ class phpbb_event_php_exporter_test extends phpbb_test_case array( "\t/**", "\t*/", - "\t\$vars = array('_Strange123', 'phpBB3_Test');", + "\t\$vars = array('_Strange123', 'phpBB_Test');", "\t\$this->dispatcher->dispatch('test');", ), 3, - array('_Strange123', 'phpBB3_Test'), + array('_Strange123', 'phpBB_Test'), ), ); } diff --git a/tests/functional/notification_test.php b/tests/functional/notification_test.php index 7eed7d371f..6d4ca21631 100644 --- a/tests/functional/notification_test.php +++ b/tests/functional/notification_test.php @@ -65,7 +65,7 @@ class phpbb_functional_notification_test extends phpbb_functional_test_case $this->login('notificationtestuser'); // Post a new post that needs approval - $this->create_post(2, 1, 'Re: Welcome to phpBB3', 'This is a test [b]post[/b] posted by notificationtestuser.', array(), 'POST_STORED_MOD'); + $this->create_post(2, 1, 'Re: Welcome to phpBB', 'This is a test [b]post[/b] posted by notificationtestuser.', array(), 'POST_STORED_MOD'); $crawler = self::request('GET', "viewtopic.php?t=1&sid={$this->sid}"); $this->assertStringNotContainsString('This is a test post posted by notificationtestuser.', $crawler->filter('html')->text()); diff --git a/tests/functional/search/base.php b/tests/functional/search/base.php index 14b4e631f6..53b251b208 100644 --- a/tests/functional/search/base.php +++ b/tests/functional/search/base.php @@ -193,13 +193,13 @@ abstract class phpbb_functional_search_base extends phpbb_functional_test_case foreach (['', 'a', 't', 'f', 'i', 's'] as $sort_key) { - $this->assert_search_found('phpbb3+installation', 1, 4, $sort_key); + $this->assert_search_found('phpbb+installation', 1, 4, $sort_key); $this->assert_search_found('foosubject+barsearch', 1, 2, $sort_key); $this->assert_search_found('barsearch-testing', 1, 2, $sort_key); // test hyphen ignored $this->assert_search_found('barsearch+-+testing', 1, 2, $sort_key); // test hyphen wrapped with space ignored $this->assert_search_found('multiple+results+count', 3, 15, $sort_key); // test multiple results count - posts $this->assert_search_found_topics('multiple+results+count', 2, $sort_key); // test multiple results count - topics - $this->assert_search_found_topics('phpbb3+installation', 1, $sort_key); + $this->assert_search_found_topics('phpbb+installation', 1, $sort_key); $this->assert_search_found_topics('foosubject+barsearch', 1, $sort_key); $this->assert_search_in_forum(2, 'multiple+search+results', 3, $sort_key); // test multiple results count - forum search - posts @@ -346,11 +346,11 @@ abstract class phpbb_functional_search_base extends phpbb_functional_test_case // Get cached post ids data $cache = $this->get_cache_driver(); $post_ids_cached = $cache->get($cache_varname); - + $cached_results_count = count($post_ids_cached) - 2; // Don't count '-1' and '-2' indexes $post_ids_cached_backup = $post_ids_cached; - + // Cached data still should have initial 'd' sort direction $this->assertTrue($post_ids_cached[-2] === 'd', $this->search_backend); diff --git a/tests/path_helper/path_helper_test.php b/tests/path_helper/path_helper_test.php index 86aaa3c734..5c41b33b97 100644 --- a/tests/path_helper/path_helper_test.php +++ b/tests/path_helper/path_helper_test.php @@ -141,22 +141,22 @@ class phpbb_path_helper_test extends phpbb_test_case array( $this->phpbb_root_path . 'test.php', '/foo/template', - '/phpbb3-fork/phpBB/app.php/foo/template', - '/phpbb3-fork/phpBB/app.php', + '/phpbb-fork/phpBB/app.php/foo/template', + '/phpbb-fork/phpBB/app.php', './../../', ), array( $this->phpbb_root_path . 'test.php', '/foo/template', - '/phpbb3-fork/phpBB/foo/template', - '/phpbb3-fork/phpBB/app.php', + '/phpbb-fork/phpBB/foo/template', + '/phpbb-fork/phpBB/app.php', './../', ), array( $this->phpbb_root_path . 'test.php', '/', - '/phpbb3-fork/phpBB/app.php/', - '/phpbb3-fork/phpBB/app.php', + '/phpbb-fork/phpBB/app.php/', + '/phpbb-fork/phpBB/app.php', './../', ), @@ -171,29 +171,29 @@ class phpbb_path_helper_test extends phpbb_test_case array( './../../' . $this->phpbb_root_path . 'test.php', '/foo/template', - '/phpbb3-fork/phpBB/app.php/foo/template', - '/phpbb3-fork/phpBB/app.php', + '/phpbb-fork/phpBB/app.php/foo/template', + '/phpbb-fork/phpBB/app.php', '', ), array( './../' . $this->phpbb_root_path . 'test.php', '/foo/template', - '/phpbb3-fork/phpBB/foo/template', - '/phpbb3-fork/phpBB/app.php', + '/phpbb-fork/phpBB/foo/template', + '/phpbb-fork/phpBB/app.php', '', ), array( './../'.$this->phpbb_root_path . 'test.php', '/', - '/phpbb3-fork/phpBB/app.php/', - '/phpbb3-fork/phpBB/app.php', + '/phpbb-fork/phpBB/app.php/', + '/phpbb-fork/phpBB/app.php', '', ), array( './../'.$this->phpbb_root_path . 'test.php', '', - '/phpbb3-fork/phpBB/foo', - '/phpbb3-fork/phpBB/app.php', + '/phpbb-fork/phpBB/foo', + '/phpbb-fork/phpBB/app.php', '', ), ); diff --git a/tests/regex/table_prefix_test.php b/tests/regex/table_prefix_test.php index bf7b59ccc6..f425041c94 100644 --- a/tests/regex/table_prefix_test.php +++ b/tests/regex/table_prefix_test.php @@ -17,7 +17,7 @@ class phpbb_regex_table_prefix_test extends phpbb_test_case { return array( array('phpbb_', 1), - array('phpBB3', 1), + array('phpBB', 1), array('a', 1), array('', 0), diff --git a/tests/ucp/controller_webpush_test.php b/tests/ucp/controller_webpush_test.php index e68d50341c..52356b6f69 100644 --- a/tests/ucp/controller_webpush_test.php +++ b/tests/ucp/controller_webpush_test.php @@ -227,7 +227,7 @@ class test_ucp_controller_webpush_test extends phpbb_database_test_case $this->assertEquals([ 'heading' => 'yourdomain.com', 'title' => 'Quoted by Guest in:', - 'text' => '"Welcome to phpBB3"', + 'text' => '"Welcome to phpBB"', 'url' => 'phpBB/viewtopic.php?p=1#p1', 'avatar' => [], ], $response_data); @@ -285,7 +285,7 @@ class test_ucp_controller_webpush_test extends phpbb_database_test_case $this->assertEquals([ 'heading' => 'yourdomain.com', 'title' => 'Quoted by Guest in:', - 'text' => '"Welcome to phpBB3"', + 'text' => '"Welcome to phpBB"', 'url' => 'phpBB/viewtopic.php?p=1#p1', 'avatar' => [], ], $response_data); @@ -393,7 +393,7 @@ class test_ucp_controller_webpush_test extends phpbb_database_test_case $this->assertEquals([ 'heading' => 'yourdomain.com', 'title' => 'Quoted by Guest in:', - 'text' => '"Welcome to phpBB3"', + 'text' => '"Welcome to phpBB"', 'url' => 'phpBB/viewtopic.php?p=1#p1', 'avatar' => [], ], $response_data); diff --git a/tests/ucp/fixtures/webpush.xml b/tests/ucp/fixtures/webpush.xml index 3e209be391..a94086b9c3 100644 --- a/tests/ucp/fixtures/webpush.xml +++ b/tests/ucp/fixtures/webpush.xml @@ -9,7 +9,7 @@ notification_time 1 - + 488c17afe4f18714c235b395e21b78df1c3d78bf1e13d0633ed9425d2eebf967 2 4 @@ -17,7 +17,7 @@ 2 - + 488c17afe4f18714c235b395e21b78df1c3d78bf1e13d0633ed9425d2eebf967 2 4