diff options
author | Andy Chase <asperous2@gmail.com> | 2013-07-05 14:49:30 -0700 |
---|---|---|
committer | Andy Chase <asperous2@gmail.com> | 2013-07-05 14:49:30 -0700 |
commit | 5cdcb689df37fd7cbaaa1b5475caa830e87be318 (patch) | |
tree | b2e0eeb07f51c9a69d4e4cc739a4767883414140 /tests/session | |
parent | 6f8187f7faadc543f3e43db278cd7239e8cf7ac7 (diff) | |
download | forums-5cdcb689df37fd7cbaaa1b5475caa830e87be318.tar forums-5cdcb689df37fd7cbaaa1b5475caa830e87be318.tar.gz forums-5cdcb689df37fd7cbaaa1b5475caa830e87be318.tar.bz2 forums-5cdcb689df37fd7cbaaa1b5475caa830e87be318.tar.xz forums-5cdcb689df37fd7cbaaa1b5475caa830e87be318.zip |
[ticket/11620] Implemented a provider mock object.
Due to an auth_refactor, there is a new dependency
in session.php on phpbb_container and a provider.
For purposes of testing, implemented a simple one.
PHPBB3-11620
Diffstat (limited to 'tests/session')
-rw-r--r-- | tests/session/testable_factory.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/session/testable_factory.php b/tests/session/testable_factory.php index 1e2b194ece..d0d0dabbec 100644 --- a/tests/session/testable_factory.php +++ b/tests/session/testable_factory.php @@ -7,6 +7,9 @@ * */ +require_once dirname(__FILE__) . '/../mock/container_builder.php'; +require_once dirname(__FILE__) . '/../mock/provider.php'; + /** * This class exists to setup an instance of phpbb's session class for testing. * @@ -16,6 +19,7 @@ */ class phpbb_session_testable_factory { + protected $container; protected $config_data; protected $cache_data; protected $cookies; @@ -65,7 +69,7 @@ class phpbb_session_testable_factory public function get_session(phpbb_db_driver $dbal) { // set up all the global variables used by session - global $SID, $_SID, $db, $config, $cache, $request; + global $SID, $_SID, $db, $config, $cache, $request, $phpbb_container; $request = $this->request = new phpbb_mock_request( array(), @@ -83,6 +87,12 @@ class phpbb_session_testable_factory $cache = $this->cache = new phpbb_mock_cache($this->get_cache_data()); $SID = $_SID = null; + $phpbb_container = $this->container = new phpbb_mock_container_builder(); + $phpbb_container->set( + 'auth.provider.db', + new phpbb_provider() + ); + $session = new phpbb_mock_session_testable; return $session; } |