Skip to content

Commit

Permalink
Simplify test
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Friedman <[email protected]>
  • Loading branch information
iMattPro committed Jan 9, 2024
1 parent 39240b9 commit 2b5fc46
Showing 1 changed file with 7 additions and 23 deletions.
30 changes: 7 additions & 23 deletions tests/event/listener_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

use phpbb\webpushnotifications\notification\method\webpush;
use phpbb\webpushnotifications\ucp\controller\webpush as ucp_webpush;
use Symfony\Component\DependencyInjection\ContainerBuilder;

class listener_test extends \phpbb_database_test_case
{
Expand Down Expand Up @@ -80,32 +79,17 @@ protected function setUp(): void
$this->user
);

$phpbb_container = $this->container = new ContainerBuilder();
$phpbb_container->set('user_loader', $user_loader);
$phpbb_container->set('user', $this->user);
$phpbb_container->set('config', $this->config);
$phpbb_container->set('dbal.conn', $db);
$phpbb_container->set('log', new \phpbb\log\dummy());
$phpbb_container->setParameter('core.root_path', $phpbb_root_path);
$phpbb_container->setParameter('core.php_ext', $phpEx);
$phpbb_container->setParameter('tables.phpbb.wpn.notification_push', 'phpbb_wpn_notification_push');
$phpbb_container->setParameter('tables.phpbb.wpn.push_subscriptions', 'phpbb_wpn_push_subscriptions');

$this->notification_method_webpush = new webpush(
$phpbb_container->get('config'),
$phpbb_container->get('dbal.conn'),
$phpbb_container->get('log'),
$phpbb_container->get('user_loader'),
$phpbb_container->get('user'),
$this->config,
$db,
new \phpbb\log\dummy(),
$user_loader,
$this->user,
$phpbb_root_path,
$phpEx,
$phpbb_container->getParameter('tables.phpbb.wpn.notification_push'),
$phpbb_container->getParameter('tables.phpbb.wpn.push_subscriptions')
'phpbb_wpn_notification_push',
'phpbb_wpn_push_subscriptions'
);

$phpbb_container->set('notification.method.phpbb.wpn.webpush', $this->notification_method_webpush);

$phpbb_container->compile();
}

protected function set_listener()
Expand Down

0 comments on commit 2b5fc46

Please sign in to comment.