diff options
author | David King <developers@inqbation.com> | 2013-07-03 12:46:18 -0400 |
---|---|---|
committer | David King <developers@inqbation.com> | 2013-07-03 12:46:18 -0400 |
commit | 73c289ae49cc43066a8642463db8afb522a59262 (patch) | |
tree | e668a03aab680ebf16b4e3a26e26fac588af41d4 /tests/session | |
parent | 8ce7d36f70111fc31f71708742e89a65014eb721 (diff) | |
parent | f9672e9b45a0f0d26702ca0f55a884a24e21bf77 (diff) | |
download | forums-73c289ae49cc43066a8642463db8afb522a59262.tar forums-73c289ae49cc43066a8642463db8afb522a59262.tar.gz forums-73c289ae49cc43066a8642463db8afb522a59262.tar.bz2 forums-73c289ae49cc43066a8642463db8afb522a59262.tar.xz forums-73c289ae49cc43066a8642463db8afb522a59262.zip |
Merge remote-tracking branch 'Hardolaf/feature/auth-refactor' into develop
* Hardolaf/feature/auth-refactor: (44 commits)
[feature/auth-refactor] Fix code style issue
[feature/auth-refactor] Fix comment grammar
[feature/auth-refactor] Fix the actual cause of test failures
[feature/auth-refactor] A possible fix for the functional test failures
[feature/auth-refactor] Forgot @inheritdoc on methods
[feature/auth-refactor] Finish and clean up documentation
[feature/auth-refactor] Change phpEx to php_ext in new classes
[feature/auth-refactor] Fix two session tests broken by changes
[feature/auth-refactor] Removed no longer used variable
[feature/auth-refactor] Fix errors in acp_board
[feature/auth-refactor] Fix indentation on acp_board
[feature/auth-refactor] Refactor auth in acp_board
[feature/auth-refactor] Don't truncate name then reattach same thing
[feature/auth-refactor] Remove old auth plugins
[feature/auth-refactor] Remove references to old auth plugins
[feature/auth-refactor] Fix auth tests to use mock objects correctly
[feature/auth-refactor] Test validate_session on provider_apache
[feature/auth-refactor] Test autologin() on provider_apache
[feature/auth-refactor] Test login() for provider_apache
[feature/auth-refactor] Test for init on provider_apache
...
Diffstat (limited to 'tests/session')
-rw-r--r-- | tests/session/continue_test.php | 13 | ||||
-rw-r--r-- | tests/session/creation_test.php | 13 |
2 files changed, 26 insertions, 0 deletions
diff --git a/tests/session/continue_test.php b/tests/session/continue_test.php index ad78d92299..e5a7f7a4a1 100644 --- a/tests/session/continue_test.php +++ b/tests/session/continue_test.php @@ -53,7 +53,20 @@ class phpbb_session_continue_test extends phpbb_database_test_case */ public function test_session_begin_valid_session($session_id, $user_id, $user_agent, $ip, $expected_sessions, $expected_cookies, $message) { + global $phpbb_container, $phpbb_root_path, $phpEx; + $db = $this->new_dbal(); + $config = new phpbb_config(array()); + $request = $this->getMock('phpbb_request'); + $user = $this->getMock('phpbb_user'); + + $auth_provider = new phpbb_auth_provider_db($db, $config, $request, $user, $phpbb_root_path, $phpEx); + $phpbb_container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'); + $phpbb_container->expects($this->any()) + ->method('get') + ->with('auth.provider.db') + ->will($this->returnValue($auth_provider)); + $session_factory = new phpbb_session_testable_factory; $session_factory->set_cookies(array( '_sid' => $session_id, diff --git a/tests/session/creation_test.php b/tests/session/creation_test.php index 6e61f085a6..fde76d6b06 100644 --- a/tests/session/creation_test.php +++ b/tests/session/creation_test.php @@ -20,7 +20,20 @@ class phpbb_session_creation_test extends phpbb_database_test_case public function test_login_session_create() { + global $phpbb_container, $phpbb_root_path, $phpEx; + $db = $this->new_dbal(); + $config = new phpbb_config(array()); + $request = $this->getMock('phpbb_request'); + $user = $this->getMock('phpbb_user'); + + $auth_provider = new phpbb_auth_provider_db($db, $config, $request, $user, $phpbb_root_path, $phpEx); + $phpbb_container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'); + $phpbb_container->expects($this->any()) + ->method('get') + ->with('auth.provider.db') + ->will($this->returnValue($auth_provider)); + $session_factory = new phpbb_session_testable_factory; $session = $session_factory->get_session($db); |