1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/17176] Update implementations to be compatible with Symfony 6.3

PHPBB3-17176
This commit is contained in:
Marc Alexander
2023-08-19 13:04:25 +02:00
parent 08160b3bc3
commit cef8aaf1a4
16 changed files with 40 additions and 34 deletions

View File

@@ -97,7 +97,8 @@ class phpbb_console_command_cron_list_test extends phpbb_test_case
);
$mock_container = new phpbb_mock_container_builder();
$mock_container->set('cron.task_collection', []);
$task_collection = new \phpbb\di\service_collection($mock_container);
$mock_container->set('cron.task_collection', $task_collection);
$this->cron_manager = new \phpbb\cron\manager($mock_container, $routing_helper, $phpbb_root_path, $pathEx, null);
$this->cron_manager->load_tasks($tasks);

View File

@@ -74,7 +74,8 @@ class phpbb_console_command_cron_run_test extends phpbb_database_test_case
);
$mock_container = new phpbb_mock_container_builder();
$mock_container->set('cron.task_collection', []);
$task_collection = new \phpbb\di\service_collection($mock_container);
$mock_container->set('cron.task_collection', $task_collection);
$this->cron_manager = new \phpbb\cron\manager($mock_container, $routing_helper, $phpbb_root_path, $phpEx, null);
$this->cron_manager->load_tasks($tasks);
@@ -152,7 +153,8 @@ class phpbb_console_command_cron_run_test extends phpbb_database_test_case
);
$mock_container = new phpbb_mock_container_builder();
$mock_container->set('cron.task_collection', []);
$task_collection = new \phpbb\di\service_collection($mock_container);
$mock_container->set('cron.task_collection', $task_collection);
$this->cron_manager = new \phpbb\cron\manager($mock_container, $routing_helper, $phpbb_root_path, $phpEx, null);
$this->cron_manager->load_tasks($tasks);
@@ -199,7 +201,8 @@ class phpbb_console_command_cron_run_test extends phpbb_database_test_case
);
$mock_container = new phpbb_mock_container_builder();
$mock_container->set('cron.task_collection', []);
$task_collection = new \phpbb\di\service_collection($mock_container);
$mock_container->set('cron.task_collection', $task_collection);
$this->cron_manager = new \phpbb\cron\manager($mock_container, $routing_helper, $phpbb_root_path, $phpEx, null);
$this->cron_manager->load_tasks($tasks);

View File

@@ -105,7 +105,8 @@ class phpbb_cron_manager_test extends \phpbb_test_case
);
$mock_container = new phpbb_mock_container_builder();
$mock_container->set('cron.task_collection', []);
$task_collection = new \phpbb\di\service_collection($mock_container);
$mock_container->set('cron.task_collection', $task_collection);
$cron_manager = new \phpbb\cron\manager($mock_container, $routing_helper, $phpbb_root_path, $phpEx, null);
$cron_manager->load_tasks($tasks);

View File

@@ -38,6 +38,6 @@ class phpbb_functional_acp_smilies_test extends phpbb_functional_test_case
$crawler = self::submit($form);
$html = $crawler->filter('#preview')->html();
$this->assertRegexp('(<img [^>]+ alt="&gt;:D" title="&gt;:D"[^>]*>)', $html);
$this->assertRegexp('(<img [^>]+ alt=">:D" title=">:D"[^>]*>)', $html);
}
}

View File

@@ -106,6 +106,7 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c
$crawler = self::request('GET', 'app.php/foo/baz', array(), false);
$this->assert_response_html(500);
$this->assertStringContainsString('Controller "foo\bar\controller\controller::baz()" requires that you provide a value for the "$test" argument', $crawler->filter('body')->text());
$this->phpbb_extension_manager->purge('foo/bar');
}
/**

View File

@@ -134,7 +134,7 @@ class phpbb_functional_ucp_attachments_test extends phpbb_functional_test_case
$attachment_filename = $crawler->filter('.attachment-filename');
$this->assertEquals('valid.jpg', $attachment_filename->attr('title'));
$this->assertStringContainsString('app.php/download/attachment/' . $attach_id . '/valid.jpg', $attachment_filename->attr('href'));
$this->assertEquals('', $crawler->filter('[name="attachment[' . $attach_id . ']"]')->attr('disabled'));
$this->assertFalse($crawler->filter('[name="attachment[' . $attach_id . ']"]')->getNode(0)->hasAttribute('disabled'));
}
public function test_ucp_delete_expired_attachment()
@@ -219,7 +219,7 @@ class phpbb_functional_ucp_attachments_test extends phpbb_functional_test_case
$this->assertEquals('valid.jpg', $attachment_node->attr('title'));
$this->assertStringContainsString('download/attachment/' . $attach_id . '/valid.jpg', $attachment_node->attr('href'));
$this->assertEquals('disabled', $crawler->filter('[name="attachment[' . $attach_id . ']"]')->attr('disabled'));
$this->assertTrue($crawler->filter('[name="attachment[' . $attach_id . ']"]')->getNode(0)->hasAttribute('disabled'));
// It should not be possible to delete the attachment
$crawler = self::request('POST', 'ucp.php?i=ucp_attachments&mode=attachments&sid=' . $this->sid, [
@@ -238,7 +238,7 @@ class phpbb_functional_ucp_attachments_test extends phpbb_functional_test_case
});
$this->assertEquals('valid.jpg', $attachment_node->attr('title'));
$this->assertStringContainsString('download/attachment/' . $attach_id . '/valid.jpg', $attachment_node->attr('href'));
$this->assertEquals('disabled', $crawler->filter('[name="attachment[' . $attach_id . ']"]')->attr('disabled'));
$this->assertTrue($crawler->filter('[name="attachment[' . $attach_id . ']"]')->getNode(0)->hasAttribute('disabled'));
$this->logout();
@@ -327,7 +327,7 @@ class phpbb_functional_ucp_attachments_test extends phpbb_functional_test_case
$this->assertEquals('valid.jpg', $attachment_node->attr('title'));
$this->assertStringContainsString('download/attachment/' . $attach_id . '/valid.jpg', $attachment_node->attr('href'));
$this->assertEquals('', $crawler->filter('[name="attachment[' . $attach_id . ']"]')->attr('disabled'));
$this->assertFalse($crawler->filter('[name="attachment[' . $attach_id . ']"]')->getNode(0)->hasAttribute('disabled'));
// Update message time to 60 minutes later
$sql = 'UPDATE ' . PRIVMSGS_TABLE . '
@@ -347,7 +347,7 @@ class phpbb_functional_ucp_attachments_test extends phpbb_functional_test_case
$this->assertEquals('valid.jpg', $attachment_node->attr('title'));
$this->assertStringContainsString('download/attachment/' . $attach_id . '/valid.jpg', $attachment_node->attr('href'));
$this->assertEquals('disabled', $crawler->filter('[name="attachment[' . $attach_id . ']"]')->attr('disabled'));
$this->assertTrue($crawler->filter('[name="attachment[' . $attach_id . ']"]')->getNode(0)->hasAttribute('disabled'));
$this->set_flood_interval(15);

View File

@@ -56,7 +56,7 @@ class phpbb_mock_container_builder implements ContainerInterface
*
* @api
*/
public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE)
public function get(string $id, int $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE): ?object
{
if ($this->has($id))
{
@@ -79,11 +79,11 @@ class phpbb_mock_container_builder implements ContainerInterface
*
* @param string $id The service identifier
*
* @return Boolean true if the service is defined, false otherwise
* @return bool true if the service is defined, false otherwise
*
* @api
*/
public function has($id)
public function has(string $id): bool
{
return isset($this->services[$id]);
}
@@ -99,7 +99,7 @@ class phpbb_mock_container_builder implements ContainerInterface
*
* @api
*/
public function getParameter($name)
public function getParameter(string $name): mixed
{
if ($this->hasParameter($name))
{
@@ -114,11 +114,11 @@ class phpbb_mock_container_builder implements ContainerInterface
*
* @param string $name The parameter name
*
* @return Boolean The presence of parameter in container
* @return bool The presence of parameter in container
*
* @api
*/
public function hasParameter($name)
public function hasParameter(string $name): bool
{
return isset($this->parameters[$name]);
}
@@ -202,7 +202,7 @@ class phpbb_mock_container_builder implements ContainerInterface
return false;
}
public function initialized($id)
public function initialized($id): bool
{
return true;
}

View File

@@ -127,8 +127,8 @@ class phpbb_path_helper_test extends phpbb_test_case
array(
$this->phpbb_root_path . 'test.php',
'/',
null,
null,
'',
'',
'',
),
array(