Merge pull request #6476 from marc1706/ticket/17108

[ticket/17108] Update composer dependencies and expect trigger error code
This commit is contained in:
Marc Alexander 2023-04-07 15:50:27 +02:00 committed by GitHub
commit 9cee7a77d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 341 additions and 351 deletions

View file

@ -10,7 +10,7 @@
{% if backend.S_STATS is not empty %} {% if backend.S_STATS is not empty %}
<form id="acp_search_index_{{ backend.TYPE }}" method="post" action="{{ U_ACTION }}"> <form id="acp_search_index_{{ backend.TYPE|replace({'\\': '-'}) }}" method="post" action="{{ U_ACTION }}">
<fieldset class="tabulated"> <fieldset class="tabulated">

648
phpBB/composer.lock generated

File diff suppressed because it is too large Load diff

View file

@ -21,6 +21,7 @@ use phpbb\di\service_collection;
use phpbb\language\language; use phpbb\language\language;
use phpbb\log\log; use phpbb\log\log;
use phpbb\request\request; use phpbb\request\request;
use phpbb\search\backend\search_backend_interface;
use phpbb\search\search_backend_factory; use phpbb\search\search_backend_factory;
use phpbb\search\state_helper; use phpbb\search\state_helper;
use phpbb\template\template; use phpbb\template\template;
@ -322,6 +323,7 @@ class acp_search
$this->tpl_name = 'acp_search_index'; $this->tpl_name = 'acp_search_index';
$this->page_title = 'ACP_SEARCH_INDEX'; $this->page_title = 'ACP_SEARCH_INDEX';
/** @var search_backend_interface $search */
foreach ($this->search_backend_collection as $search) foreach ($this->search_backend_collection as $search)
{ {
$this->template->assign_block_vars('backends', [ $this->template->assign_block_vars('backends', [

View file

@ -101,6 +101,7 @@ class extension extends \Twig\Extension\AbstractExtension
* Returns a list of operators to add to the existing list. * Returns a list of operators to add to the existing list.
* *
* @return array[] An array of operators * @return array[] An array of operators
* @psalm-suppress LessSpecificImplementedReturnType
*/ */
public function getOperators() public function getOperators()
{ {

View file

@ -230,7 +230,7 @@ abstract class phpbb_functional_search_base extends phpbb_functional_test_case
// Ensure search index has been actually created // Ensure search index has been actually created
$crawler = self::request('GET', 'adm/index.php?i=acp_search&mode=index&sid=' . $this->sid); $crawler = self::request('GET', 'adm/index.php?i=acp_search&mode=index&sid=' . $this->sid);
$posts_indexed = (int) $crawler->filter('#acp_search_index_' . $search_type . ' td')->eq(1)->text(); $posts_indexed = (int) $crawler->filter('#acp_search_index_' . str_replace('\\', '-', $search_type) . ' td')->eq(1)->text();
$this->assertTrue($posts_indexed > 0); $this->assertTrue($posts_indexed > 0);
} }
@ -267,7 +267,7 @@ abstract class phpbb_functional_search_base extends phpbb_functional_test_case
// Ensure search index has been actually removed // Ensure search index has been actually removed
$crawler = self::request('GET', 'adm/index.php?i=acp_search&mode=index&sid=' . $this->sid); $crawler = self::request('GET', 'adm/index.php?i=acp_search&mode=index&sid=' . $this->sid);
$posts_indexed = (int) $crawler->filter('#acp_search_index_' . $this->search_backend . ' td')->eq(1)->text(); $posts_indexed = (int) $crawler->filter('#acp_search_index_' . str_replace('\\', '-', $this->search_backend) . ' td')->eq(1)->text();
$this->assertEquals(0, $posts_indexed); $this->assertEquals(0, $posts_indexed);
} }
} }

View file

@ -106,34 +106,17 @@ class phpbb_test_case_helpers
public function setExpectedTriggerError($errno, $message = '') public function setExpectedTriggerError($errno, $message = '')
{ {
$exceptionName = ''; set_error_handler(
switch ($errno) static function ($errno, $errstr)
{ {
case E_NOTICE: restore_error_handler();
case E_STRICT: throw new Exception($errstr, $errno);
// The static property was removed from PHPUnit since v.8.3.0 },
if (isset(PHPUnit\Framework\Error\Notice::$enabled)) E_ALL
{ );
PHPUnit\Framework\Error\Notice::$enabled = true;
}
$exceptionName = 'PHPUnit\Framework\Error\Notice';
break;
case E_WARNING:
// The static property was removed from PHPUnit since v.8.3.0
if (isset(PHPUnit\Framework\Error\Warning::$enabled))
{
PHPUnit\Framework\Error\Warning::$enabled = true;
}
$exceptionName = 'PHPUnit\Framework\Error\Warning';
break;
default:
$exceptionName = 'PHPUnit\Framework\Error\Error';
break;
}
$this->expectedTriggerError = true; $this->expectedTriggerError = true;
$this->test_case->expectException($exceptionName); $this->test_case->expectException(Exception::class);
$this->test_case->expectExceptionCode($errno); $this->test_case->expectExceptionCode($errno);
if ($message) if ($message)
{ {