Compare commits

..

9 commits

Author SHA1 Message Date
rxu
41d25cc19f
[ticket/17496] Fix recently added changes
PHPBB-17496
2025-04-28 18:06:36 +07:00
rxu
a84dac7719
[ticket/17496] Sniffer to support question mark nullable type syntax
PHPBB-17496
2025-04-25 22:26:24 +07:00
rxu
c5cdc1ce2e
[ticket/17496] Correctly restore willReturn()
PHPBB-17496
2025-04-25 22:26:24 +07:00
rxu
acdecf29f7
[ticket/17496] Fix tests
PHPBB-17496
2025-04-25 22:26:23 +07:00
rxu
b4291d5538
[ticket/17496] Upgrade to the most recent GuzzleHTTP 7.9
PHPBB-17496
2025-04-25 22:26:23 +07:00
rxu
b7ab9b1e99
[ticket/17496] Fix tests
PHPUnit will automatically create a test double
of required return type to be returned

PHPBB-17496
2025-04-25 22:26:22 +07:00
rxu
2200bfb0a8
[ticket/17496] Upgrade to GuzzleHTTP 7.8 as PHP 8.4-compatible
PHPBB-17496
2025-04-25 22:26:22 +07:00
rxu
aa068ded9d
[ticket/17496] Unused use statements sniffer to check union types
PHPBB-17496
2025-04-25 22:26:22 +07:00
rxu
d92bd71e1a
[ticket/17496] Fix Implicitly marking parameters as nullable PHP deprecations
Also use union types consistently instead of question marks.
Fixed with php-cs-fixer.

PHPBB-17496
2025-04-25 22:26:17 +07:00
12 changed files with 256 additions and 394 deletions

View file

@ -10,4 +10,5 @@
#
set -e
sudo apt-get update
sudo apt-get install -y parallel libimage-exiftool-perl

View file

@ -11,6 +11,7 @@
set -e
set -x
sudo apt-get update
sudo apt-get install -q -y sphinxsearch
DIR=$(dirname "$0")
@ -134,7 +135,7 @@ searchd
read_timeout = 5
max_children = 30
pid_file = $SPHINX_DATA_DIR/searchd.pid
binlog_path = $SPHINX_DATA_DIR
binlog_path = $SPHINX_DATA_DIR/
}
" > $SPHINX_CONF

View file

@ -10,4 +10,5 @@
#
set -e
sudo apt-get update
sudo apt-get install -y expect-dev

View file

@ -11,6 +11,7 @@
set -e
set -x
sudo apt-get update
sudo apt-get install -y nginx coreutils
sudo service nginx stop

View file

@ -28,10 +28,6 @@ jobs:
name: PHP ${{ matrix.php }} - ${{ matrix.db }}
steps:
- name: Update Ubuntu package lists
run: |
sudo apt-get update -y --allow-releaseinfo-change
- name: Checkout repository
uses: actions/checkout@v4
with:
@ -173,10 +169,6 @@ jobs:
- 6379:6379
steps:
- name: Update Ubuntu package lists
run: |
sudo apt-get update -y --allow-releaseinfo-change
- name: Checkout repository
uses: actions/checkout@v4
@ -316,10 +308,6 @@ jobs:
- 6379:6379
steps:
- name: Update Ubuntu package lists
run: |
sudo apt-get update -y --allow-releaseinfo-change
- name: Checkout repository
uses: actions/checkout@v4
@ -424,10 +412,6 @@ jobs:
steps:
- name: Update Ubuntu package lists
run: |
sudo apt-get update -y --allow-releaseinfo-change
- name: Checkout repository
uses: actions/checkout@v4

Binary file not shown.

579
phpBB/composer.lock generated

File diff suppressed because it is too large Load diff

View file

@ -952,7 +952,7 @@ class fulltext_sphinx implements search_backend_interface
array('read_timeout', '5'),
array('max_children', '30'),
array('pid_file', $this->config['fulltext_sphinx_data_path'] . 'searchd.pid'),
array('binlog_path', rtrim($this->config['fulltext_sphinx_data_path'], '/\\')), // Trim trailing slash
array('binlog_path', $this->config['fulltext_sphinx_data_path']),
),
);

View file

@ -263,12 +263,7 @@ abstract class phpbb_functional_search_base extends phpbb_functional_test_case
// Ensure search index has been actually created
$crawler = self::request('GET', 'adm/index.php?i=acp_search&mode=index&sid=' . $this->sid);
$posts_indexed = (int) $crawler->filter('#acp_search_index_' . str_replace('\\', '-', $search_type) . ' td')->reduce(
function ($node, $i) {
// Find the value of total posts indexed
return (strpos($node->text(), $this->lang('FULLTEXT_MYSQL_TOTAL_POSTS')) !== false || strpos($node->text(), $this->lang('TOTAL_WORDS')) !== false);
})
->nextAll()->eq(0)->text();
$posts_indexed = (int) $crawler->filter('#acp_search_index_' . str_replace('\\', '-', $search_type) . ' td')->eq(1)->text();
$this->assertTrue($posts_indexed > 0);
}
@ -305,12 +300,7 @@ abstract class phpbb_functional_search_base extends phpbb_functional_test_case
// Ensure search index has been actually removed
$crawler = self::request('GET', 'adm/index.php?i=acp_search&mode=index&sid=' . $this->sid);
$posts_indexed = (int) $crawler->filter('#acp_search_index_' . str_replace('\\', '-', $this->search_backend) . ' td')->reduce(
function ($node, $i) {
// Find the value of total posts indexed
return (strpos($node->text(), $this->lang('FULLTEXT_MYSQL_TOTAL_POSTS')) !== false || strpos($node->text(), $this->lang('TOTAL_WORDS')) !== false);
})
->nextAll()->eq(0)->text();
$posts_indexed = (int) $crawler->filter('#acp_search_index_' . str_replace('\\', '-', $this->search_backend) . ' td')->eq(1)->text();
$this->assertEquals(0, $posts_indexed);
}
}

View file

@ -27,10 +27,8 @@ class phpbb_functional_search_sphinx_test extends phpbb_functional_search_base
if (!$backend || $this->search_backend == $backend)
{
$output = $retval = null;
// After creating phpBB search index, build Sphinx index
exec('sudo -S service sphinxsearch stop', $output, $retval); // Attempt to stop sphinxsearch service in case it's running
exec('sudo -S service sphinxsearch stop', $output, $retval); // Attemtp to stop sphinxsearch service in case it's running
exec('sudo -S indexer --all', $output, $retval); // Run sphinxsearch indexer
exec('sudo -S service sphinxsearch start', $output, $retval); // Attempt to start sphinxsearch service again
}

View file

@ -601,16 +601,7 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_
// Assert new topic title is indexed as well
$this->add_lang('search');
self::request('GET', "search.php?keywords=bang&sid={$this->sid}");
// Sphinx search doesn't apply to unapproved or softdeleted posts
if (strpos($this->get_search_type(), 'fulltext_sphinx'))
{
$this->assertStringContainsString(sprintf($this->lang['FOUND_SEARCH_MATCHES'][2], 0), self::get_content());
}
else
{
$this->assertStringContainsString(sprintf($this->lang['FOUND_SEARCH_MATCHES'][1], 1), self::get_content());
}
$this->assertStringContainsString(sprintf($this->lang['FOUND_SEARCH_MATCHES'][1], 1), self::get_content());
}
public function test_move_topic_back()

View file

@ -895,24 +895,6 @@ class phpbb_functional_test_case extends phpbb_test_case
return $group_id;
}
/**
* Get current board's search type
*
* @return string Current search type setting
*/
protected function get_search_type()
{
$db = $this->get_db();
$sql = 'SELECT config_value as search_type
FROM ' . CONFIG_TABLE . "
WHERE config_name = '" . $db->sql_escape('search_type') . "'";
$result = $db->sql_query($sql);
$search_type = $db->sql_fetchfield('search_type');
$db->sql_freeresult($result);
return $search_type;
}
protected function remove_user_group($group_name, $usernames)
{
global $db, $cache, $auth, $config, $phpbb_dispatcher, $phpbb_log, $phpbb_container, $user, $phpbb_root_path, $phpEx;