1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-06 16:56:44 +02:00

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
6 changed files with 341 additions and 351 deletions

View File

@@ -230,7 +230,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_' . $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);
}
@@ -267,7 +267,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_' . $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);
}
}

View File

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