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

[ticket/12352] Use custom provider collection for auth providers

Using this custom provider collection, we can properly check whether the
configured auth provider does exist. The method get_provider() has been added
for returning the default auth provider or the standard db auth provider if
the specified one does not exist.
Additionally, the method get_provider() will throw an RuntimeException if
none of the above exist.

PHPBB3-12352
This commit is contained in:
Marc Alexander
2014-05-31 22:43:07 +02:00
parent 306beab4cb
commit 6f5f0d6d8d
5 changed files with 73 additions and 32 deletions

View File

@@ -96,9 +96,11 @@ class phpbb_session_testable_factory
'auth.provider.db',
new phpbb_mock_auth_provider()
);
$provider_collection = new \phpbb\auth\provider_collection($phpbb_container, $config);
$provider_collection->add('auth.provider.db');
$phpbb_container->set(
'auth.provider_collection',
array('auth.provider.db' => $phpbb_container->get('auth.provider.db'))
$provider_collection
);
$session = new phpbb_mock_session_testable;