mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-10 13:28:55 +00:00
[ticket/16649] Add compiler pass to tests
PHPBB3-16649
This commit is contained in:
parent
302632d240
commit
538ff83ccc
5 changed files with 18 additions and 3 deletions
|
@ -198,9 +198,6 @@ class container_builder
|
||||||
|
|
||||||
$this->container = $this->create_container($this->container_extensions);
|
$this->container = $this->create_container($this->container_extensions);
|
||||||
|
|
||||||
// Mark all services public
|
|
||||||
$this->container->addCompilerPass(new pass\markpublic_pass());
|
|
||||||
|
|
||||||
// Easy collections through tags
|
// Easy collections through tags
|
||||||
$this->container->addCompilerPass(new pass\collection_pass());
|
$this->container->addCompilerPass(new pass\collection_pass());
|
||||||
|
|
||||||
|
@ -220,6 +217,9 @@ class container_builder
|
||||||
|
|
||||||
$this->inject_custom_parameters();
|
$this->inject_custom_parameters();
|
||||||
|
|
||||||
|
// Mark all services public
|
||||||
|
$this->container->addCompilerPass(new pass\markpublic_pass());
|
||||||
|
|
||||||
if ($this->compile_container)
|
if ($this->compile_container)
|
||||||
{
|
{
|
||||||
$this->container->compile();
|
$this->container->compile();
|
||||||
|
|
|
@ -36,5 +36,13 @@ class markpublic_pass implements CompilerPassInterface
|
||||||
$definition->setPublic(true);
|
$definition->setPublic(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach ($container->getAliases() as $alias)
|
||||||
|
{
|
||||||
|
if ($alias->isPrivate())
|
||||||
|
{
|
||||||
|
$alias->setPublic(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -125,6 +125,9 @@ abstract class phpbb_tests_notification_base extends phpbb_database_test_case
|
||||||
);
|
);
|
||||||
|
|
||||||
$phpbb_container->set('notification_manager', $this->notifications);
|
$phpbb_container->set('notification_manager', $this->notifications);
|
||||||
|
|
||||||
|
$phpbb_container->addCompilerPass(new phpbb\di\pass\markpublic_pass());
|
||||||
|
|
||||||
$phpbb_container->compile();
|
$phpbb_container->compile();
|
||||||
|
|
||||||
$this->notifications->setDependencies($this->auth, $this->config);
|
$this->notifications->setDependencies($this->auth, $this->config);
|
||||||
|
|
|
@ -129,6 +129,9 @@ class notification_method_email_test extends phpbb_tests_notification_base
|
||||||
);
|
);
|
||||||
|
|
||||||
$phpbb_container->set('notification_manager', $this->notifications);
|
$phpbb_container->set('notification_manager', $this->notifications);
|
||||||
|
|
||||||
|
$phpbb_container->addCompilerPass(new phpbb\di\pass\markpublic_pass());
|
||||||
|
|
||||||
$phpbb_container->compile();
|
$phpbb_container->compile();
|
||||||
|
|
||||||
$this->notifications->setDependencies($this->auth, $this->config);
|
$this->notifications->setDependencies($this->auth, $this->config);
|
||||||
|
|
|
@ -137,6 +137,7 @@ abstract class phpbb_notification_submit_post_base extends phpbb_database_test_c
|
||||||
$phpbb_container->setParameter('tables.notification_types', 'phpbb_notification_types');
|
$phpbb_container->setParameter('tables.notification_types', 'phpbb_notification_types');
|
||||||
$phpbb_container->setParameter('tables.notification_emails', 'phpbb_notification_emails');
|
$phpbb_container->setParameter('tables.notification_emails', 'phpbb_notification_emails');
|
||||||
$phpbb_container->set('content.visibility', new \phpbb\content_visibility($auth, $config, $phpbb_dispatcher, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE));
|
$phpbb_container->set('content.visibility', new \phpbb\content_visibility($auth, $config, $phpbb_dispatcher, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE));
|
||||||
|
$phpbb_container->addCompilerPass(new phpbb\di\pass\markpublic_pass());
|
||||||
$phpbb_container->compile();
|
$phpbb_container->compile();
|
||||||
|
|
||||||
// Notification Types
|
// Notification Types
|
||||||
|
|
Loading…
Add table
Reference in a new issue