From 3df19411b48e7d6704a5de64cdd2ff1bc8e64ced Mon Sep 17 00:00:00 2001 From: rxu Date: Mon, 10 Aug 2020 15:02:25 +0700 Subject: [PATCH] [ticket/16549] Fix tests PHPBB3-16549 --- tests/attachment/upload_test.php | 21 ++- tests/avatar/manager_test.php | 12 +- tests/cache/cache_memory.php | 2 +- tests/cache/cache_memory_test.php | 2 +- tests/console/user/base.php | 7 +- tests/content_visibility/delete_post_test.php | 2 + tests/dbal/db_tools_test.php | 2 +- tests/email/email_parsing_test.php | 1 + tests/error_collector_test.php | 10 +- tests/files/types_local_test.php | 10 +- tests/functional/acp_groups_test.php | 6 +- tests/functional/avatar_acp_groups_test.php | 2 +- tests/functional/smilies_test.php | 2 +- tests/functions/user_delete_test.php | 1 + tests/functions/validate_num_test.php | 4 +- tests/functions/validate_user_email_test.php | 1 + .../phpbb_format_quote_test.php | 1 + tests/notification/base.php | 2 + .../notification_method_email_test.php | 11 +- tests/notification/notification_test.php | 7 + tests/notification/submit_post_base.php | 4 + .../submit_post_type_topic_test.php | 7 +- tests/notification/user_list_trim_test.php | 5 +- tests/profilefields/manager_test.php | 2 + tests/profilefields/type_bool_test.php | 6 +- tests/profilefields/type_date_test.php | 2 + tests/profilefields/type_dropdown_test.php | 5 +- tests/profilefields/type_int_test.php | 4 + tests/profilefields/type_string_test.php | 4 + tests/profilefields/type_url_test.php | 4 + tests/session/check_ban_test.php | 10 ++ tests/session/session_key_test.php | 6 + tests/session/testable_facade.php | 4 +- tests/template/extension_test.php | 2 + tests/template/template_test.php | 3 +- .../template/templates/loop_expressions.html | 12 +- .../phpbb_functional_test_case.php | 18 ++- .../phpbb_test_case_helpers.php | 21 ++- tests/text_formatter/s9e/renderer_test.php | 13 +- .../generate_text_for_display_test.php | 7 +- tests/upload/fileupload_test.php | 24 +++- tests/version/version_test.php | 134 ++++++++++++++++++ travis/setup-phpbb.sh | 2 +- 43 files changed, 351 insertions(+), 54 deletions(-) diff --git a/tests/attachment/upload_test.php b/tests/attachment/upload_test.php index ae2c96ba84..69714d93f9 100644 --- a/tests/attachment/upload_test.php +++ b/tests/attachment/upload_test.php @@ -144,6 +144,7 @@ class phpbb_attachment_upload_test extends \phpbb_database_test_case $this->phpbb_dispatcher = new phpbb_mock_event_dispatcher(); $this->temp = new \phpbb\filesystem\temp($this->filesystem, ''); $this->user = new \phpbb\user($this->language, '\phpbb\datetime'); + $this->user->data['user_id'] = ANONYMOUS; $this->upload = new \phpbb\attachment\upload( $this->auth, @@ -187,7 +188,14 @@ class phpbb_attachment_upload_test extends \phpbb_database_test_case ) ), array('foobar', 1, true, - array(), + // Instead of setting to false or empty array, set default filedata array + // as otherwise it throws PHP undefined array key warnings + // in different file upload related services + array( + 'realname' => null, + 'type' => null, + 'size' => null, + ), array( 'error' => array( 'NOT_UPLOADED', @@ -250,7 +258,16 @@ class phpbb_attachment_upload_test extends \phpbb_database_test_case $this->user ); - $filedata = $this->upload->upload('foobar', 1, true); + // Instead of setting to false or empty array, set default filedata array + // as otherwise it throws PHP undefined array key warnings + // in different file upload related services + $filedata = $this->upload->upload('foobar', 1, true, '', false, + [ + 'realname' => null, + 'type' => null, + 'size' => null, + ] + ); $this->assertSame(array( 'error' => array(), diff --git a/tests/avatar/manager_test.php b/tests/avatar/manager_test.php index a94ba102f5..a1e43646e7 100644 --- a/tests/avatar/manager_test.php +++ b/tests/avatar/manager_test.php @@ -330,7 +330,9 @@ class phpbb_avatar_manager_test extends \phpbb_database_test_case 'avatar_type' => '', 'avatar_width' => 0, 'avatar_height' => 0, - ), 1, array( + ), + array( + 'id' => 1, 'avatar' => 'foobar@example.com', 'avatar_type' => 'avatar.driver.gravatar', 'avatar_width' => '16', @@ -343,7 +345,9 @@ class phpbb_avatar_manager_test extends \phpbb_database_test_case 'avatar_type' => '', 'avatar_width' => 0, 'avatar_height' => 0, - ), 5, array( + ), + array( + 'id' => 5, 'avatar' => 'g5_1414350991.jpg', 'avatar_type' => 'avatar.driver.upload', 'avatar_width' => '80', @@ -356,13 +360,13 @@ class phpbb_avatar_manager_test extends \phpbb_database_test_case /** * @dataProvider data_handle_avatar_delete */ - public function test_handle_avatar_delete($expected, $id, $avatar_data, $table, $prefix) + public function test_handle_avatar_delete($expected, $avatar_data, $table, $prefix) { $this->config['allow_avatar_gravatar'] = true; $this->assertNull($this->manager->handle_avatar_delete($this->db, $this->user, $avatar_data, $table, $prefix)); $sql = 'SELECT * FROM ' . $table . ' - WHERE ' . $prefix . 'id = ' . $id; + WHERE ' . $prefix . 'id = ' . (int) $avatar_data['id']; $result = $this->db->sql_query_limit($sql, 1); $row = $this->manager->clean_row($this->db->sql_fetchrow($result), substr($prefix, 0, -1)); diff --git a/tests/cache/cache_memory.php b/tests/cache/cache_memory.php index 565e9a48eb..1f7b31a86b 100644 --- a/tests/cache/cache_memory.php +++ b/tests/cache/cache_memory.php @@ -31,7 +31,7 @@ class phpbb_cache_memory extends \phpbb\cache\driver\memory */ function _read($var) { - return $this->data[$var]; + return $this->data[$var] ?? false; } /** diff --git a/tests/cache/cache_memory_test.php b/tests/cache/cache_memory_test.php index b3d19f1782..3a465aef7e 100644 --- a/tests/cache/cache_memory_test.php +++ b/tests/cache/cache_memory_test.php @@ -123,7 +123,7 @@ class phpbb_cache_memory_test extends phpbb_database_test_case foreach ($sql_queries as $query) { - $this->assertNotEquals(false, $this->cache->sql_load($query[0])); + $this->assertFalse($this->cache->sql_load($query[0])); } } } diff --git a/tests/console/user/base.php b/tests/console/user/base.php index c40a0070ac..fd8acf935c 100644 --- a/tests/console/user/base.php +++ b/tests/console/user/base.php @@ -62,7 +62,12 @@ abstract class phpbb_console_user_base extends phpbb_database_test_case $this->language->expects($this->any()) ->method('lang') ->will($this->returnArgument(0)); - $user = $this->user = $this->createMock('\phpbb\user'); + + $user = $this->user = $this->createMock('\phpbb\user', array(), array( + $this->language, + '\phpbb\datetime' + )); + $user->data['user_email'] = ''; $this->user_loader = new \phpbb\user_loader($db, $phpbb_root_path, $phpEx, USERS_TABLE); diff --git a/tests/content_visibility/delete_post_test.php b/tests/content_visibility/delete_post_test.php index 35a8eedb80..f888fd001a 100644 --- a/tests/content_visibility/delete_post_test.php +++ b/tests/content_visibility/delete_post_test.php @@ -311,6 +311,8 @@ class phpbb_content_visibility_delete_post_test extends phpbb_database_test_case $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx); $lang = new \phpbb\language\language($lang_loader); $user = new \phpbb\user($lang, '\phpbb\datetime'); + $user->data['user_id'] = ANONYMOUS; + $attachment_delete = new \phpbb\attachment\delete($config, $db, new \phpbb_mock_event_dispatcher(), new \phpbb\attachment\resync($db), $storage); $phpbb_dispatcher = new phpbb_mock_event_dispatcher(); diff --git a/tests/dbal/db_tools_test.php b/tests/dbal/db_tools_test.php index ba5f40003d..0f7a37a8da 100644 --- a/tests/dbal/db_tools_test.php +++ b/tests/dbal/db_tools_test.php @@ -425,7 +425,7 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case public function test_create_int_default_null() { $this->assertFalse($this->tools->sql_column_exists('prefix_table_name', 'c_bug_13282')); - $this->assertTrue($this->tools->sql_column_add('prefix_table_name', 'c_bug_13282', array('TINT:2'))); + $this->assertTrue($this->tools->sql_column_add('prefix_table_name', 'c_bug_13282', array('TINT:2', null))); $this->assertTrue($this->tools->sql_column_exists('prefix_table_name', 'c_bug_13282')); } diff --git a/tests/email/email_parsing_test.php b/tests/email/email_parsing_test.php index c3515c26f8..5c4844927e 100644 --- a/tests/email/email_parsing_test.php +++ b/tests/email/email_parsing_test.php @@ -52,6 +52,7 @@ class phpbb_email_parsing_test extends phpbb_test_case $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx); $lang = new \phpbb\language\language($lang_loader); $user = new \phpbb\user($lang, '\phpbb\datetime'); + $user->data['user_lang'] = 'en'; $phpbb_container->set('user', $user); $extension_manager = new phpbb_mock_extension_manager( dirname(__FILE__) . '/', diff --git a/tests/error_collector_test.php b/tests/error_collector_test.php index 7b73679fda..e1bbd89f12 100644 --- a/tests/error_collector_test.php +++ b/tests/error_collector_test.php @@ -51,14 +51,16 @@ class phpbb_error_collector_test extends phpbb_test_case // Cause a warning 1/0; $line = __LINE__; - // Cause a notice - $array = array(0 => 'value'); - $value = $array[1]; $line2 = __LINE__; + // Cause a "Notice: unserialize(): Error at offset 0 of 27 bytes in ..." + // "Undefined array index" used earlier was promoted to warning in PHP 8.0, + // see https://github.com/php/php-src/commit/c48b745f0090c944e77c1fbcfb6c4df3b54356ad + unserialize("obvious non-serialized data"); $line2 = __LINE__; $collector->uninstall(); // The notice should not be collected - $this->assertEmpty($collector->errors[1]); + $this->assertFalse(isset($collector->errors[1])); + $this->assertEquals(count($collector->errors), 1); list($errno, $msg_text, $errfile, $errline) = $collector->errors[0]; $error_contents = $collector->format_errors(); diff --git a/tests/files/types_local_test.php b/tests/files/types_local_test.php index 106f8cda2f..e4cfd49064 100644 --- a/tests/files/types_local_test.php +++ b/tests/files/types_local_test.php @@ -102,6 +102,7 @@ class phpbb_files_types_local_test extends phpbb_test_case array( 'foo', array( + 'realname' => null, 'tmp_name' => 'foo', 'size' => 500, 'type' => 'image/png', @@ -110,13 +111,17 @@ class phpbb_files_types_local_test extends phpbb_test_case ), array( 'none', - false, + array( + 'realname' => null, + 'size' => null, + 'type' => null, + ), array('PHP_SIZE_OVERRUN'), ), array( 'tests/upload/fixture/png', array( - 'realname' => 'foo.png', + 'realname' => 'foo.png', 'size' => 500, 'type' => 'image/png', 'local_mode' => true, @@ -151,7 +156,6 @@ class phpbb_files_types_local_test extends phpbb_test_case $upload->set_allowed_extensions(array('png')); $type_local->set_upload($upload); - $file = $type_local->upload($filename, $upload_ary); $this->assertSame($expected, $file->error); $this->assertInstanceOf('\phpbb\files\filespec', $file); diff --git a/tests/functional/acp_groups_test.php b/tests/functional/acp_groups_test.php index f574115d62..06001fd262 100644 --- a/tests/functional/acp_groups_test.php +++ b/tests/functional/acp_groups_test.php @@ -117,8 +117,10 @@ class phpbb_functional_acp_groups_test extends phpbb_functional_common_groups_te else { $this->form_data = $form->getValues(); - $this->assertEquals($tick_legend, $this->form_data['group_legend']); - $this->assertEquals($tick_teampage, $this->form_data['group_teampage']); + // form_data[] values can be bool or null if not ticked, $tick_* value can be bool or null if not set. + // Cast both to the same type to correctly compare the values. + $this->assertEquals((bool) $tick_legend, (bool) ($this->form_data['group_legend'] ?? false)); + $this->assertEquals((bool) $tick_teampage, (bool) ($this->form_data['group_teampage'] ?? false)); } } } diff --git a/tests/functional/avatar_acp_groups_test.php b/tests/functional/avatar_acp_groups_test.php index ca8c84ab2e..f9251fd2f0 100644 --- a/tests/functional/avatar_acp_groups_test.php +++ b/tests/functional/avatar_acp_groups_test.php @@ -80,6 +80,6 @@ class phpbb_functional_avatar_acp_groups_test extends phpbb_functional_common_av $crawler = self::request('GET', $this->get_url() . '&sid=' . $this->sid); $form = $crawler->selectButton($this->lang('SUBMIT'))->form(); $form_data = $form->getValues(); - $this->assertEmpty($form_data['avatar_type']); + $this->assertFalse(isset($form_data['avatar_type'])); } } diff --git a/tests/functional/smilies_test.php b/tests/functional/smilies_test.php index f17171bd1f..11d36908a7 100644 --- a/tests/functional/smilies_test.php +++ b/tests/functional/smilies_test.php @@ -39,7 +39,7 @@ class phpbb_functional_smilies_test extends phpbb_functional_test_case $crawler = self::request('GET', 'posting.php?mode=smilies'); foreach ($smilies as $index => $smiley) { - $this->assertContains($smiley['smiley_url'], + $this->assertStringContainsString($smiley['smiley_url'], $crawler->filter('div[class="inner"] > a > img')->eq($index)->attr('src') ); } diff --git a/tests/functions/user_delete_test.php b/tests/functions/user_delete_test.php index 27e1acefdd..93006124d8 100644 --- a/tests/functions/user_delete_test.php +++ b/tests/functions/user_delete_test.php @@ -33,6 +33,7 @@ class phpbb_functions_user_delete_test extends phpbb_database_test_case $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx); $lang = new \phpbb\language\language($lang_loader); $user = new \phpbb\user($lang, '\phpbb\datetime'); + $user->data['user_id'] = 2; $phpbb_dispatcher = new phpbb_mock_event_dispatcher(); $phpbb_container = new phpbb_mock_container_builder(); $config = new \phpbb\config\config(array( diff --git a/tests/functions/validate_num_test.php b/tests/functions/validate_num_test.php index acbdc49614..26470d12f4 100644 --- a/tests/functions/validate_num_test.php +++ b/tests/functions/validate_num_test.php @@ -30,7 +30,7 @@ class phpbb_functions_validate_num_test extends phpbb_test_case $this->helper->assert_valid_data(array( 'empty' => array( array(), - '', + null, // '' < 0 is true since PHP 8.0, hence use null instead of '' (empty string) array('num'), ), 'zero' => array( @@ -54,7 +54,7 @@ class phpbb_functions_validate_num_test extends phpbb_test_case array('num', false, 2, 3), ), 'string' => array( - array(), + version_compare(PHP_VERSION, '7.5', '<=') ? [] : ['TOO_LARGE'], // See https://wiki.php.net/rfc/string_to_number_comparison 'foobar', array('num'), ), diff --git a/tests/functions/validate_user_email_test.php b/tests/functions/validate_user_email_test.php index eeb5bfc2a9..fc22b7ac64 100644 --- a/tests/functions/validate_user_email_test.php +++ b/tests/functions/validate_user_email_test.php @@ -38,6 +38,7 @@ class phpbb_functions_validate_user_email_test extends phpbb_database_test_case $phpbb_dispatcher = new phpbb_mock_event_dispatcher(); $language = new phpbb\language\language(new phpbb\language\language_file_loader($phpbb_root_path, $phpEx)); $this->user = new phpbb\user($language, '\phpbb\datetime'); + $this->user->data['user_email'] = ''; $this->helper = new phpbb_functions_validate_data_helper($this); } diff --git a/tests/functions_content/phpbb_format_quote_test.php b/tests/functions_content/phpbb_format_quote_test.php index eed1ec5e46..2f19c198e7 100644 --- a/tests/functions_content/phpbb_format_quote_test.php +++ b/tests/functions_content/phpbb_format_quote_test.php @@ -25,6 +25,7 @@ class phpbb_functions_content_phpbb_format_quote_test extends phpbb_test_case $lang_file_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx); $this->lang = new \phpbb\language\language($lang_file_loader); $user = new \phpbb\user($this->lang, '\phpbb\datetime'); + $user->data['user_options'] = 230271; $cache = new phpbb_mock_cache(); parent::setUp(); diff --git a/tests/notification/base.php b/tests/notification/base.php index 1622d12363..e9de0daac1 100644 --- a/tests/notification/base.php +++ b/tests/notification/base.php @@ -74,6 +74,8 @@ abstract class phpbb_tests_notification_base extends phpbb_database_test_case $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx); $lang = new \phpbb\language\language($lang_loader); $user = new \phpbb\user($lang, '\phpbb\datetime'); + $user->data['user_id'] = 0; + $user->data['user_type'] = USER_NORMAL; $this->user = $user; $this->user_loader = new \phpbb\user_loader($this->db, $phpbb_root_path, $phpEx, 'phpbb_users'); $auth = $this->auth = new phpbb_mock_notifications_auth(); diff --git a/tests/notification/notification_method_email_test.php b/tests/notification/notification_method_email_test.php index 62f7385215..d944846f76 100644 --- a/tests/notification/notification_method_email_test.php +++ b/tests/notification/notification_method_email_test.php @@ -249,7 +249,16 @@ class notification_method_email_test extends phpbb_tests_notification_base */ public function test_notification_email($notification_type, $post_data, $expected_users) { - $post_data = array_merge(['post_time' => 1349413322], $post_data); + $post_data = array_merge([ + 'post_time' => 1349413322, + 'poster_id' => 1, + 'topic_title' => '', + 'post_subject' => '', + 'post_username' => '', + 'forum_name' => '', + ], + + $post_data); $notification_options = [ 'item_id' => $post_data['post_id'], 'item_parent_id' => $post_data['topic_id'], diff --git a/tests/notification/notification_test.php b/tests/notification/notification_test.php index 24a9d2e686..307f67ac10 100644 --- a/tests/notification/notification_test.php +++ b/tests/notification/notification_test.php @@ -160,6 +160,8 @@ class phpbb_notification_test extends phpbb_tests_notification_base 'post_subject' => 'Re: test-title', 'forum_id' => 2, 'forum_name' => 'Your first forum', + 'post_username' => '', + 'post_text' => 'test text', )); $this->db->sql_query('INSERT INTO ' . BOOKMARKS_TABLE . ' ' . $this->db->sql_build_array('INSERT', array( @@ -176,6 +178,8 @@ class phpbb_notification_test extends phpbb_tests_notification_base 'post_subject' => 'Re: test-title', 'forum_id' => 2, 'forum_name' => 'Your first forum', + 'post_username' => '', + 'post_text' => 'test text', )); $this->notifications->delete_subscription('test'); @@ -267,6 +271,9 @@ class phpbb_notification_test extends phpbb_tests_notification_base 'post_subject' => 'Re: test-title2', // change post_subject 'forum_id' => 3, // change forum_id 'forum_name' => 'Your second forum', // change forum_name + 'post_username' => '', + 'post_text' => 'test text2', + 'post_time' => 1349413325, )); $this->assert_notifications( diff --git a/tests/notification/submit_post_base.php b/tests/notification/submit_post_base.php index 032b8a25fe..f144e486a3 100644 --- a/tests/notification/submit_post_base.php +++ b/tests/notification/submit_post_base.php @@ -39,6 +39,9 @@ abstract class phpbb_notification_submit_post_base extends phpbb_database_test_c 'bbcode_bitfield' => '', 'bbcode_uid' => '', 'post_edit_locked' => false, + 'notify_set' => 0, + 'notify' => false, + 'forum_name' => 'Test forum name', //'force_approved_state' => 1, ); @@ -102,6 +105,7 @@ abstract class phpbb_notification_submit_post_base extends phpbb_database_test_c 'username' => 'user-name', 'is_registered' => true, 'user_colour' => '', + 'user_lastmark' => 0, ); // Request diff --git a/tests/notification/submit_post_type_topic_test.php b/tests/notification/submit_post_type_topic_test.php index a2adfcdda8..e5da423903 100644 --- a/tests/notification/submit_post_type_topic_test.php +++ b/tests/notification/submit_post_type_topic_test.php @@ -135,9 +135,10 @@ class phpbb_notification_submit_post_type_topic_test extends phpbb_notification_ $this->db->sql_freeresult($result); $result = $this->db->sql_query( - 'SELECT * - FROM ' . POSTS_TABLE . ' - WHERE post_id = ' . $reply_id); + 'SELECT p.*, t.topic_posts_approved, t.topic_posts_unapproved, t.topic_posts_softdeleted, t.topic_first_post_id, t.topic_last_post_id + FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t + WHERE p.topic_id = t.topic_id + AND p.post_id = ' . $reply_id); $reply_edit_data = array_merge($this->post_data, $this->db->sql_fetchrow($result), array( 'force_approved_state' => false, 'post_edit_reason' => 'PHPBB3-12370', diff --git a/tests/notification/user_list_trim_test.php b/tests/notification/user_list_trim_test.php index 0542d6ab78..f4cebda515 100644 --- a/tests/notification/user_list_trim_test.php +++ b/tests/notification/user_list_trim_test.php @@ -51,7 +51,10 @@ class phpbb_notification_user_list_trim_test extends phpbb_database_test_case $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx); $lang = new \phpbb\language\language($lang_loader); $user = new \phpbb\user($lang, '\phpbb\datetime'); - $user->data = array('user_lang' => 'en'); + $user->data = [ + 'user_id' => 1, + 'user_lang' => 'en', + ]; $lang->add_lang('common'); $user_loader = new phpbb\user_loader($db, $phpbb_root_path, $phpEx, USERS_TABLE); diff --git a/tests/profilefields/manager_test.php b/tests/profilefields/manager_test.php index 1bf40550ca..efb91dea84 100644 --- a/tests/profilefields/manager_test.php +++ b/tests/profilefields/manager_test.php @@ -63,6 +63,8 @@ class manager_test extends phpbb_database_test_case $language = new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)); $collection = new \phpbb\di\service_collection($container); $user = new \phpbb\user($language, '\phpbb\datetime'); + $user->data['user_id'] = 2; + $user->ip = ''; $this->log = new \phpbb\log\log($this->db, $user, $auth, $dispatcher, $phpbb_root_path, 'adm/', $phpEx, $table_prefix . 'log'); diff --git a/tests/profilefields/type_bool_test.php b/tests/profilefields/type_bool_test.php index 8806e2fadd..cfdec04eda 100644 --- a/tests/profilefields/type_bool_test.php +++ b/tests/profilefields/type_bool_test.php @@ -65,8 +65,10 @@ class phpbb_profilefield_type_bool_test extends phpbb_test_case 'lang_id' => 1, 'lang_name' => 'field', 'field_required' => false, - 'field_default_value' => 1, - 'field_length' => 1, + 'field_default_value' => 1, + 'field_length' => 1, + 'field_show_novalue' => null, + 'field_novalue' => null, ); $this->options = array( diff --git a/tests/profilefields/type_date_test.php b/tests/profilefields/type_date_test.php index 7b2d4112dc..75de0773d2 100644 --- a/tests/profilefields/type_date_test.php +++ b/tests/profilefields/type_date_test.php @@ -55,6 +55,8 @@ class phpbb_profilefield_type_date_test extends phpbb_test_case 'lang_id' => 1, 'lang_name' => 'field', 'field_required' => false, + 'field_show_novalue' => null, + 'field_novalue' => null, ); } diff --git a/tests/profilefields/type_dropdown_test.php b/tests/profilefields/type_dropdown_test.php index 86cd413240..8919fbb6a4 100644 --- a/tests/profilefields/type_dropdown_test.php +++ b/tests/profilefields/type_dropdown_test.php @@ -66,6 +66,7 @@ class phpbb_profilefield_type_dropdown_test extends phpbb_test_case 'field_required' => false, 'field_validation' => '.*', 'field_novalue' => 0, + 'field_show_novalue' => null, ); $this->dropdown_options = array( @@ -153,7 +154,7 @@ class phpbb_profilefield_type_dropdown_test extends phpbb_test_case 'Field should output nothing for empty value', ), array( - '', + null, // Since PHP 8, '' == 0 returns false, hence use null instead of '' (empty string) array('field_show_novalue' => false), null, 'Field should simply output null for empty value', @@ -184,7 +185,7 @@ class phpbb_profilefield_type_dropdown_test extends phpbb_test_case 'Field should return the correct raw value', ), array( - '', + null, // Since PHP 8, '' == 0 returns false, hence use null instead of '' (empty string) array('field_show_novalue' => false), null, 'Field should null for empty value without show_novalue', diff --git a/tests/profilefields/type_int_test.php b/tests/profilefields/type_int_test.php index 733f397911..a4161ce412 100644 --- a/tests/profilefields/type_int_test.php +++ b/tests/profilefields/type_int_test.php @@ -44,6 +44,10 @@ class phpbb_profilefield_type_int_test extends phpbb_test_case 'lang_id' => 1, 'lang_name' => 'field', 'field_required' => false, + 'field_show_novalue' => null, + 'field_novalue' => null, + 'field_minlen' => null, + 'field_maxlen' => null, ); } diff --git a/tests/profilefields/type_string_test.php b/tests/profilefields/type_string_test.php index a8d0399fd4..a813cc248b 100644 --- a/tests/profilefields/type_string_test.php +++ b/tests/profilefields/type_string_test.php @@ -49,6 +49,10 @@ class phpbb_profilefield_type_string_test extends phpbb_test_case 'lang_name' => 'field', 'field_required' => false, 'field_validation' => '.*', + 'field_show_novalue' => null, + 'field_novalue' => null, + 'field_minlen' => null, + 'field_maxlen' => null, ); } diff --git a/tests/profilefields/type_url_test.php b/tests/profilefields/type_url_test.php index d203234f2a..581257ad53 100644 --- a/tests/profilefields/type_url_test.php +++ b/tests/profilefields/type_url_test.php @@ -52,6 +52,10 @@ class phpbb_profilefield_type_url_test extends phpbb_test_case 'lang_id' => 1, 'lang_name' => 'field', 'field_required' => false, + 'field_show_novalue' => null, + 'field_novalue' => null, + 'field_minlen' => null, + 'field_maxlen' => null, ); } diff --git a/tests/session/check_ban_test.php b/tests/session/check_ban_test.php index 96e550609e..ef92ad5451 100644 --- a/tests/session/check_ban_test.php +++ b/tests/session/check_ban_test.php @@ -43,6 +43,16 @@ class phpbb_session_check_ban_test extends phpbb_session_test_case parent::setUp(); // Get session here so that config is mocked correctly $this->session = $this->session_factory->get_session($this->db); + $this->session->data['user_id'] = ANONYMOUS; // Don't get into the session_kill() procedure + $this->session->lang = [ + 'BOARD_BAN_TIME' => 'BOARD_BAN_TIME', + 'BOARD_BAN_PERM' => 'BOARD_BAN_PERM', + 'BOARD_BAN_REASON' => 'BOARD_BAN_REASON', + 'BAN_TRIGGERED_BY_EMAIL' => 'BAN_TRIGGERED_BY_EMAIL', + 'BAN_TRIGGERED_BY_IP' => 'BAN_TRIGGERED_BY_IP', + 'BAN_TRIGGERED_BY_USER' => 'BAN_TRIGGERED_BY_USER', + ]; + global $cache, $config, $phpbb_root_path, $phpEx, $phpbb_filesystem; $phpbb_filesystem = new \phpbb\filesystem\filesystem(); diff --git a/tests/session/session_key_test.php b/tests/session/session_key_test.php index 2499ea1d55..2a62da2eb5 100644 --- a/tests/session/session_key_test.php +++ b/tests/session/session_key_test.php @@ -34,6 +34,8 @@ class phpbb_session_login_keys_test extends phpbb_session_test_case $session->cookie_data['k'] = $this->key_id; // Try to access session with the session key + global $request, $symfony_request, $phpbb_filesystem, $phpbb_root_path; + $session->page = $session->extract_current_page($phpbb_root_path); $session->session_create(false, false, false); $this->assertEquals($this->user_id, $session->data['user_id'], 'User should be logged in by the session key'); } @@ -45,6 +47,8 @@ class phpbb_session_login_keys_test extends phpbb_session_test_case $session = $this->session_factory->get_session($this->db); // Reset of the keys for this user + $session->cookie_data['k'] = $this->key_id; + $session->data['user_id'] = $this->user_id; $session->reset_login_keys($this->user_id); // Using a user_id and key that was in the database (before reset) @@ -52,6 +56,8 @@ class phpbb_session_login_keys_test extends phpbb_session_test_case $session->cookie_data['k'] = $this->key_id; // Try to access session with the session key + global $request, $symfony_request, $phpbb_filesystem, $phpbb_root_path; + $session->page = $session->extract_current_page($phpbb_root_path); $session->session_create(false, false, $this->user_id); $this->assertNotEquals($this->user_id, $session->data['user_id'], 'User is not logged in because the session key is invalid'); diff --git a/tests/session/testable_facade.php b/tests/session/testable_facade.php index 05858c8a63..2a2b24fb27 100644 --- a/tests/session/testable_facade.php +++ b/tests/session/testable_facade.php @@ -94,10 +94,12 @@ class phpbb_session_testable_facade $this->session_factory->merge_config_data($config_overrides); // Bots $this->session_factory->merge_cache_data(array('_bots' => $bot_overrides)); - global $request; + global $request, $symfony_request, $phpbb_filesystem, $phpbb_root_path; $session = $this->session_factory->get_session($this->db); $session->browser = $user_agent; $session->ip = $ip_address; + $session->page = $session->extract_current_page($phpbb_root_path); + // Uri sid if ($uri_sid) { diff --git a/tests/template/extension_test.php b/tests/template/extension_test.php index a00a89ee46..7bdd6ba591 100644 --- a/tests/template/extension_test.php +++ b/tests/template/extension_test.php @@ -33,6 +33,8 @@ class phpbb_template_extension_test extends phpbb_template_template_test_case global $auth, $request, $symfony_request, $user; $user = new phpbb_mock_user(); $user->optionset('user_id', 2); + $user->style['style_path'] = ''; + $user->data['user_id'] = 2; $auth = $this->getMockBuilder('phpbb\auth\auth') ->disableOriginalConstructor() ->setMethods(['acl_get']) diff --git a/tests/template/template_test.php b/tests/template/template_test.php index 51d519a2b1..fa84cb9770 100644 --- a/tests/template/template_test.php +++ b/tests/template/template_test.php @@ -493,7 +493,8 @@ class phpbb_template_template_test extends phpbb_template_template_test_case array( 'loop_expressions.html', array(), - array('loop' => array(array(),array(),array(),array(),array(),array()),), + // Do not use 'loop' as a block name to not override Twig's internal 'loop' object + array('loop1' => array(array(),array(),array(),array(),array(),array()),), array(), 'yesnononoyesnoyesnonoyesnono', ), diff --git a/tests/template/templates/loop_expressions.html b/tests/template/templates/loop_expressions.html index ddb9fd52fa..e983c0cc42 100644 --- a/tests/template/templates/loop_expressions.html +++ b/tests/template/templates/loop_expressions.html @@ -1,11 +1,11 @@ - + -yesno +yesno - + - + -yesno +yesno - + diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php index 60dacd936b..97ff1f62cc 100644 --- a/tests/test_framework/phpbb_functional_test_case.php +++ b/tests/test_framework/phpbb_functional_test_case.php @@ -721,7 +721,14 @@ class phpbb_functional_test_case extends phpbb_test_case $db = $this->get_db(); $phpbb_dispatcher = new phpbb_mock_event_dispatcher(); - $user = $this->createMock('\phpbb\user'); + + $user = $this->createMock('\phpbb\user', array(), array( + new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)), + '\phpbb\datetime' + )); + $user->data['user_id'] = 2; // admin + $user->ip = ''; + $auth = $this->createMock('\phpbb\auth\auth'); $phpbb_log = new \phpbb\log\log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE); @@ -755,7 +762,14 @@ class phpbb_functional_test_case extends phpbb_test_case $db = $this->get_db(); $phpbb_dispatcher = new phpbb_mock_event_dispatcher(); - $user = $this->createMock('\phpbb\user'); + + $user = $this->createMock('\phpbb\user', array(), array( + new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)), + '\phpbb\datetime' + )); + $user->data['user_id'] = 2; // admin + $user->ip = ''; + $auth = $this->createMock('\phpbb\auth\auth'); $phpbb_log = new \phpbb\log\log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE); diff --git a/tests/test_framework/phpbb_test_case_helpers.php b/tests/test_framework/phpbb_test_case_helpers.php index ce394fc510..347f70f3c9 100644 --- a/tests/test_framework/phpbb_test_case_helpers.php +++ b/tests/test_framework/phpbb_test_case_helpers.php @@ -531,6 +531,14 @@ class phpbb_test_case_helpers if ($container->has('user')) { $user = $container->get('user'); + + // Set default required user data if not set + $user->data['is_bot'] = $user->data['is_bot'] ?? false; + $user->data['is_registered'] = $user->data['is_registered'] ?? false; + $user->data['style_id'] = $user->data['style_id'] ?? 1; + $user->data['user_id'] = $user->data['user_id'] ?? ANONYMOUS; + $user->data['user_options'] = $user->data['user_options'] ?? 230271; + $user->style['style_id'] = $user->style['style_id'] ?? 1; } else { @@ -545,6 +553,14 @@ class phpbb_test_case_helpers ->method('format_date') ->will($this->test_case->returnCallback(__CLASS__ . '::format_date')); + // Set default required user data + $user->data['is_bot'] = false; + $user->data['is_registered'] = false; + $user->data['style_id'] = 1; + $user->data['user_id'] = ANONYMOUS; + $user->data['user_options'] = 230271; + $user->style['style_id'] = 1; + $user->date_format = 'Y-m-d H:i:s'; $user->optionset('viewcensors', true); $user->optionset('viewflash', true); @@ -555,11 +571,6 @@ class phpbb_test_case_helpers } $user->add_lang('common'); - if (!isset($user->style)) - { - $user->style = array('style_id' => 1); - } - // Create and register a quote_helper $quote_helper = new \phpbb\textformatter\s9e\quote_helper( $container->get('user'), diff --git a/tests/text_formatter/s9e/renderer_test.php b/tests/text_formatter/s9e/renderer_test.php index 672069590a..f34c656359 100644 --- a/tests/text_formatter/s9e/renderer_test.php +++ b/tests/text_formatter/s9e/renderer_test.php @@ -61,7 +61,10 @@ class phpbb_textformatter_s9e_renderer_test extends phpbb_test_case ->getMock(); $factory->expects($this->once()) ->method('regenerate') - ->will($this->returnValue(array('parser' => $mock))); + ->will($this->returnValue([ + 'parser' => $mock, + 'renderer' => $mock, + ])); $renderer = new \phpbb\textformatter\s9e\renderer( $cache, @@ -160,6 +163,7 @@ class phpbb_textformatter_s9e_renderer_test extends phpbb_test_case $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx); $lang = new \phpbb\language\language($lang_loader); $user = new \phpbb\user($lang, '\phpbb\datetime'); + $user->data['user_options'] = 230271; $user->optionset('viewcensors', false); $phpbb_container->set('user', $user); @@ -175,6 +179,7 @@ class phpbb_textformatter_s9e_renderer_test extends phpbb_test_case $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx); $lang = new \phpbb\language\language($lang_loader); $user = new \phpbb\user($lang, '\phpbb\datetime'); + $user->data['user_options'] = 230271; $user->optionset('viewcensors', false); $config = new \phpbb\config\config(array('allow_nocensors' => true)); @@ -193,6 +198,7 @@ class phpbb_textformatter_s9e_renderer_test extends phpbb_test_case $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx); $lang = new \phpbb\language\language($lang_loader); $user = new \phpbb\user($lang, '\phpbb\datetime'); + $user->data['user_options'] = 230271; $user->optionset('viewcensors', false); $config = new \phpbb\config\config(array('allow_nocensors' => true)); @@ -222,6 +228,7 @@ class phpbb_textformatter_s9e_renderer_test extends phpbb_test_case $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx); $lang = new \phpbb\language\language($lang_loader); $user = new \phpbb\user($lang, '\phpbb\datetime'); + $user->data['user_options'] = 230271; $user->optionset('viewflash', false); $phpbb_container->set('user', $user); @@ -241,6 +248,7 @@ class phpbb_textformatter_s9e_renderer_test extends phpbb_test_case $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx); $lang = new \phpbb\language\language($lang_loader); $user = new \phpbb\user($lang, '\phpbb\datetime'); + $user->data['user_options'] = 230271; $user->optionset('viewimg', false); $phpbb_container->set('user', $user); @@ -260,7 +268,8 @@ class phpbb_textformatter_s9e_renderer_test extends phpbb_test_case $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx); $lang = new \phpbb\language\language($lang_loader); $user = new \phpbb\user($lang, '\phpbb\datetime'); - $user->optionset('smilies', false); + $user->data['user_options'] = 230271; + $user->optionset('viewsmilies', false); $phpbb_container->set('user', $user); } diff --git a/tests/text_processing/generate_text_for_display_test.php b/tests/text_processing/generate_text_for_display_test.php index 8429c16c3a..64ab695c6e 100644 --- a/tests/text_processing/generate_text_for_display_test.php +++ b/tests/text_processing/generate_text_for_display_test.php @@ -37,6 +37,7 @@ class phpbb_text_processing_generate_text_for_display_test extends phpbb_test_ca $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx); $lang = new \phpbb\language\language($lang_loader); $user = new \phpbb\user($lang, '\phpbb\datetime'); + $user->data['user_options'] = 230271; $user->optionset('viewcensors', true); $user->optionset('viewflash', true); $user->optionset('viewimg', true); @@ -72,6 +73,7 @@ class phpbb_text_processing_generate_text_for_display_test extends phpbb_test_ca $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx); $lang = new \phpbb\language\language($lang_loader); $user = new \phpbb\user($lang, '\phpbb\datetime'); + $user->data['user_options'] = 230271; // Do not ignore word censoring by user (switch censoring on in UCP) $user->optionset('viewcensors', true); @@ -172,6 +174,7 @@ class phpbb_text_processing_generate_text_for_display_test extends phpbb_test_ca $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx); $lang = new \phpbb\language\language($lang_loader); $user = new \phpbb\user($lang, '\phpbb\datetime'); + $user->data['user_options'] = 230271; $user->optionset('viewflash', false); $phpbb_container->set('user', $user); @@ -192,6 +195,7 @@ class phpbb_text_processing_generate_text_for_display_test extends phpbb_test_ca $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx); $lang = new \phpbb\language\language($lang_loader); $user = new \phpbb\user($lang, '\phpbb\datetime'); + $user->data['user_options'] = 230271; $user->optionset('viewimg', false); $phpbb_container->set('user', $user); @@ -212,7 +216,8 @@ class phpbb_text_processing_generate_text_for_display_test extends phpbb_test_ca $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx); $lang = new \phpbb\language\language($lang_loader); $user = new \phpbb\user($lang, '\phpbb\datetime'); - $user->optionset('smilies', false); + $user->data['user_options'] = 230271; + $user->optionset('viewsmilies', false); $phpbb_container->set('user', $user); } diff --git a/tests/upload/fileupload_test.php b/tests/upload/fileupload_test.php index a5b897d180..f72187167f 100644 --- a/tests/upload/fileupload_test.php +++ b/tests/upload/fileupload_test.php @@ -186,7 +186,13 @@ class phpbb_fileupload_test extends phpbb_test_case ->set_max_filesize(1000); copy($this->path . 'jpg', $this->path . 'jpg.jpg'); - $file = $upload->handle_upload('files.types.local', $this->path . 'jpg.jpg'); + // Upload file data should be set to prevent "Undefined array key" PHP 8 warning + $filedata = [ + 'size' => 519, + 'realname' => $this->path . 'jpg.jpg', + 'type' => false, + ]; + $file = $upload->handle_upload('files.types.local', $this->path . 'jpg.jpg', $filedata); $this->assertEquals(0, count($file->error)); $this->assertFalse($file->additional_checks()); $this->assertTrue($file->move_file('../tests/upload/fixture/copies', true)); @@ -200,7 +206,13 @@ class phpbb_fileupload_test extends phpbb_test_case ->set_max_filesize(1000); copy($this->path . 'jpg', $this->path . 'jpg.jpg'); - $file = $upload->handle_upload('files.types.local', $this->path . 'jpg.jpg'); + // Upload file data should be set to prevent "Undefined array key" PHP 8 warning + $filedata = [ + 'size' => 519, + 'realname' => $this->path . 'jpg.jpg', + 'type' => false, + ]; + $file = $upload->handle_upload('files.types.local', $this->path . 'jpg.jpg', $filedata); $this->assertEquals(0, count($file->error)); $this->assertFalse($file->move_file('../tests/upload/fixture')); $this->assertFalse($file->get('file_moved')); @@ -215,7 +227,13 @@ class phpbb_fileupload_test extends phpbb_test_case copy($this->path . 'jpg', $this->path . 'jpg.jpg'); copy($this->path . 'jpg', $this->path . 'copies/jpg.jpg'); - $file = $upload->handle_upload('files.types.local', $this->path . 'jpg.jpg'); + // Upload file data should be set to prevent "Undefined array key" PHP 8 warning + $filedata = [ + 'size' => 519, + 'realname' => $this->path . 'jpg.jpg', + 'type' => false, + ]; + $file = $upload->handle_upload('files.types.local', $this->path . 'jpg.jpg', $filedata); $this->assertEquals(0, count($file->error)); $file->move_file('../tests/upload/fixture/copies', true); $this->assertEquals(0, count($file->error)); diff --git a/tests/version/version_test.php b/tests/version/version_test.php index 561367fd03..84637bdda5 100644 --- a/tests/version/version_test.php +++ b/tests/version/version_test.php @@ -353,13 +353,19 @@ class phpbb_version_helper_test extends phpbb_test_case array( '1.0' => array( 'current' => '1.0.1', + 'eol' => false, + 'security' => false, ), '1.1' => array( 'current' => '1.1.1', + 'eol' => false, + 'security' => false, ), ), array( 'current' => '1.0.1', + 'eol' => false, + 'security' => false, ), ), array( @@ -367,9 +373,13 @@ class phpbb_version_helper_test extends phpbb_test_case array( '1.0' => array( 'current' => '1.0.1', + 'eol' => false, + 'security' => false, ), '1.1' => array( 'current' => '1.1.1', + 'eol' => false, + 'security' => false, ), ), array(), @@ -379,13 +389,19 @@ class phpbb_version_helper_test extends phpbb_test_case array( '1.0' => array( 'current' => '1.0.1-a2', + 'eol' => false, + 'security' => false, ), '1.1' => array( 'current' => '1.1.0', + 'eol' => false, + 'security' => false, ), ), array( 'current' => '1.0.1-a2', + 'eol' => false, + 'security' => false, ), ), array( @@ -393,13 +409,19 @@ class phpbb_version_helper_test extends phpbb_test_case array( '1.0' => array( 'current' => '1.0.1', + 'eol' => false, + 'security' => false, ), '1.1' => array( 'current' => '1.1.1', + 'eol' => false, + 'security' => false, ), ), array( 'current' => '1.1.1', + 'eol' => false, + 'security' => false, ), ), array( @@ -407,9 +429,13 @@ class phpbb_version_helper_test extends phpbb_test_case array( '1.0' => array( 'current' => '1.0.1', + 'eol' => false, + 'security' => false, ), '1.1' => array( 'current' => '1.1.1', + 'eol' => false, + 'security' => false, ), ), array(), @@ -419,13 +445,19 @@ class phpbb_version_helper_test extends phpbb_test_case array( '1.0' => array( 'current' => '1.0.1', + 'eol' => false, + 'security' => false, ), '1.1' => array( 'current' => '1.1.0-a2', + 'eol' => false, + 'security' => false, ), ), array( 'current' => '1.1.0-a2', + 'eol' => false, + 'security' => false, ), ), array( @@ -439,14 +471,18 @@ class phpbb_version_helper_test extends phpbb_test_case array( '1.0' => array( 'current' => '1.0.1', + 'eol' => false, 'security' => '1.0.1', ), '1.1' => array( 'current' => '1.1.1', + 'eol' => false, + 'security' => false, ), ), array( 'current' => '1.0.1', + 'eol' => false, 'security' => '1.0.1', ), ), @@ -456,14 +492,18 @@ class phpbb_version_helper_test extends phpbb_test_case array( '1.0' => array( 'current' => '1.0.1', + 'eol' => false, 'security' => '1.0.0', ), '1.1' => array( 'current' => '1.1.1', + 'eol' => false, + 'security' => false, ), ), array( 'current' => '1.0.1', + 'eol' => false, 'security' => '1.0.0', ), ), @@ -473,14 +513,19 @@ class phpbb_version_helper_test extends phpbb_test_case array( '1.0' => array( 'current' => '1.0.1', + 'eol' => false, 'security' => '1.1.0', ), '1.1' => array( 'current' => '1.1.1', + 'eol' => false, + 'security' => false, ), ), array( 'current' => '1.1.1', + 'eol' => false, + 'security' => false, ), ), // Latest 1.0 release is EOL @@ -490,13 +535,18 @@ class phpbb_version_helper_test extends phpbb_test_case '1.0' => array( 'current' => '1.0.1', 'eol' => true, + 'security' => false, ), '1.1' => array( 'current' => '1.1.1', + 'eol' => false, + 'security' => false, ), ), array( 'current' => '1.1.1', + 'eol' => false, + 'security' => false, ), ), // All are EOL -- somewhat undefined behavior @@ -506,10 +556,12 @@ class phpbb_version_helper_test extends phpbb_test_case '1.0' => array( 'current' => '1.0.1', 'eol' => true, + 'security' => false, ), '1.1' => array( 'current' => '1.1.1', 'eol' => true, + 'security' => false, ), ), array(), @@ -560,10 +612,14 @@ class phpbb_version_helper_test extends phpbb_test_case array( '3.1' => array( 'current' => '1.0.1', + 'eol' => false, + 'security' => false, ), ), array( 'current' => '1.0.1', + 'eol' => false, + 'security' => false, ), ), array( @@ -572,6 +628,8 @@ class phpbb_version_helper_test extends phpbb_test_case array( '3.1' => array( 'current' => '1.0.1', + 'eol' => false, + 'security' => false, ), ), array(), @@ -582,10 +640,14 @@ class phpbb_version_helper_test extends phpbb_test_case array( '3.2' => array( 'current' => '1.1.1', + 'eol' => false, + 'security' => false, ), ), array( 'current' => '1.1.1', + 'eol' => false, + 'security' => false, ), ), array( @@ -594,6 +656,8 @@ class phpbb_version_helper_test extends phpbb_test_case array( '3.2' => array( 'current' => '1.1.1', + 'eol' => false, + 'security' => false, ), ), array(), @@ -605,10 +669,14 @@ class phpbb_version_helper_test extends phpbb_test_case array( '3.2' => array( 'current' => '1.1.1', + 'eol' => false, + 'security' => false, ), ), array( 'current' => '1.1.1', + 'eol' => false, + 'security' => false, ), ), array( @@ -617,6 +685,8 @@ class phpbb_version_helper_test extends phpbb_test_case array( '3.2' => array( 'current' => '1.1.1', + 'eol' => false, + 'security' => false, ), ), array(), @@ -627,10 +697,14 @@ class phpbb_version_helper_test extends phpbb_test_case array( '3.1' => array( 'current' => '1.0.1', + 'eol' => false, + 'security' => false, ), ), array( 'current' => '1.0.1', + 'eol' => false, + 'security' => false, ), ), array( @@ -639,6 +713,8 @@ class phpbb_version_helper_test extends phpbb_test_case array( '3.1' => array( 'current' => '1.0.1', + 'eol' => false, + 'security' => false, ), ), array(), @@ -649,10 +725,14 @@ class phpbb_version_helper_test extends phpbb_test_case array( '3.2' => array( 'current' => '1.1.1', + 'eol' => false, + 'security' => false, ), ), array( 'current' => '1.1.1', + 'eol' => false, + 'security' => false, ), ), array( @@ -661,6 +741,8 @@ class phpbb_version_helper_test extends phpbb_test_case array( '3.2' => array( 'current' => '1.1.1', + 'eol' => false, + 'security' => false, ), ), array(), @@ -672,13 +754,19 @@ class phpbb_version_helper_test extends phpbb_test_case array( '3.1' => array( 'current' => '1.0.1', + 'eol' => false, + 'security' => false, ), '3.2' => array( 'current' => '1.1.1', + 'eol' => false, + 'security' => false, ), ), array( 'current' => '1.0.1', + 'eol' => false, + 'security' => false, ), ), array( @@ -687,9 +775,13 @@ class phpbb_version_helper_test extends phpbb_test_case array( '3.1' => array( 'current' => '1.0.1', + 'eol' => false, + 'security' => false, ), '3.2' => array( 'current' => '1.1.1', + 'eol' => false, + 'security' => false, ), ), array(), @@ -700,9 +792,13 @@ class phpbb_version_helper_test extends phpbb_test_case array( '3.1' => array( 'current' => '1.0.1', + 'eol' => false, + 'security' => false, ), '3.2' => array( 'current' => '1.1.1', + 'eol' => false, + 'security' => false, ), ), array(), @@ -713,13 +809,19 @@ class phpbb_version_helper_test extends phpbb_test_case array( '3.1' => array( 'current' => '1.0.1', + 'eol' => false, + 'security' => false, ), '3.2' => array( 'current' => '1.1.1', + 'eol' => false, + 'security' => false, ), ), array( 'current' => '1.1.1', + 'eol' => false, + 'security' => false, ), ), array( @@ -728,13 +830,19 @@ class phpbb_version_helper_test extends phpbb_test_case array( '3.1' => array( 'current' => '1.0.1', + 'eol' => false, + 'security' => false, ), '3.2' => array( 'current' => '1.1.1', + 'eol' => false, + 'security' => false, ), ), array( 'current' => '1.1.1', + 'eol' => false, + 'security' => false, ), ), array( @@ -743,9 +851,13 @@ class phpbb_version_helper_test extends phpbb_test_case array( '3.1' => array( 'current' => '1.0.1', + 'eol' => false, + 'security' => false, ), '3.2' => array( 'current' => '1.1.1', + 'eol' => false, + 'security' => false, ), ), array(), @@ -757,13 +869,19 @@ class phpbb_version_helper_test extends phpbb_test_case array( '3.1' => array( 'current' => '1.0.1', + 'eol' => false, + 'security' => false, ), '3.2' => array( 'current' => '1.1.1', + 'eol' => false, + 'security' => false, ), ), array( 'current' => '1.1.1', + 'eol' => false, + 'security' => false, ), ), array( @@ -772,13 +890,19 @@ class phpbb_version_helper_test extends phpbb_test_case array( '3.1' => array( 'current' => '1.0.1', + 'eol' => false, + 'security' => false, ), '3.2' => array( 'current' => '1.1.1', + 'eol' => false, + 'security' => false, ), ), array( 'current' => '1.1.1', + 'eol' => false, + 'security' => false, ), ), array( @@ -787,13 +911,19 @@ class phpbb_version_helper_test extends phpbb_test_case array( '3.1' => array( 'current' => '1.0.1', + 'eol' => false, + 'security' => false, ), '3.2' => array( 'current' => '1.1.1', + 'eol' => false, + 'security' => false, ), ), array( 'current' => '1.1.1', + 'eol' => false, + 'security' => false, ), ), array( @@ -802,9 +932,13 @@ class phpbb_version_helper_test extends phpbb_test_case array( '3.1' => array( 'current' => '1.0.1', + 'eol' => false, + 'security' => false, ), '3.2' => array( 'current' => '1.1.1', + 'eol' => false, + 'security' => false, ), ), array(), diff --git a/travis/setup-phpbb.sh b/travis/setup-phpbb.sh index 8d23865d08..ed736517b2 100755 --- a/travis/setup-phpbb.sh +++ b/travis/setup-phpbb.sh @@ -41,6 +41,6 @@ php ../composer.phar install --dev --no-interaction if [ "$TRAVIS_PHP_VERSION" == "nightly" ] then php ../composer.phar remove phpunit/dbunit --dev --update-with-dependencies \ - && php ../composer.phar require symfony/yaml:~4.4 misantron/dbunit:~5.0 nikic/php-parser:~4.7 phpunit/phpunit:^9.3 --dev --update-with-all-dependencies --ignore-platform-reqs + && php ../composer.phar require symfony/yaml:~4.4 misantron/dbunit:~5.0 phpunit/phpunit:^9.3 --dev --update-with-all-dependencies --ignore-platform-reqs fi cd ..