aboutsummaryrefslogtreecommitdiffstats
path: root/tests/mock
diff options
context:
space:
mode:
Diffstat (limited to 'tests/mock')
-rw-r--r--tests/mock/cache.php8
-rw-r--r--tests/mock/container_builder.php15
-rw-r--r--tests/mock/session_testable.php6
3 files changed, 20 insertions, 9 deletions
diff --git a/tests/mock/cache.php b/tests/mock/cache.php
index 5fa3d28147..2306fd9009 100644
--- a/tests/mock/cache.php
+++ b/tests/mock/cache.php
@@ -72,13 +72,13 @@ class phpbb_mock_cache implements \phpbb\cache\driver\driver_interface
}
}
- public function checkVar(PHPUnit_Framework_Assert $test, $var_name, $data)
+ public function checkVar(PHPUnit\Framework\Assert $test, $var_name, $data)
{
$test->assertTrue(isset($this->data[$var_name]));
$test->assertEquals($data, $this->data[$var_name]);
}
- public function checkAssociativeVar(PHPUnit_Framework_Assert $test, $var_name, $data, $sort = true)
+ public function checkAssociativeVar(PHPUnit\Framework\Assert $test, $var_name, $data, $sort = true)
{
$test->assertTrue(isset($this->data[$var_name]));
@@ -93,12 +93,12 @@ class phpbb_mock_cache implements \phpbb\cache\driver\driver_interface
$test->assertEquals($data, $this->data[$var_name]);
}
- public function checkVarUnset(PHPUnit_Framework_Assert $test, $var_name)
+ public function checkVarUnset(PHPUnit\Framework\Assert $test, $var_name)
{
$test->assertFalse(isset($this->data[$var_name]));
}
- public function check(PHPUnit_Framework_Assert $test, $data, $ignore_db_info = true)
+ public function check(PHPUnit\Framework\Assert $test, $data, $ignore_db_info = true)
{
$cache_data = $this->data;
diff --git a/tests/mock/container_builder.php b/tests/mock/container_builder.php
index 134589b0b8..17c4ae22dd 100644
--- a/tests/mock/container_builder.php
+++ b/tests/mock/container_builder.php
@@ -18,16 +18,22 @@ class phpbb_mock_container_builder implements ContainerInterface
protected $services = array();
protected $parameters = array();
+ public function __construct()
+ {
+ $this->setParameter('debug.load_time', false);
+ $this->setParameter('session.log_errors', false);
+ }
+
/**
* Sets a service.
*
* @param string $id The service identifier
* @param object $service The service instance
- * @param string $scope The scope of the service
+ * @param bool $shared Whether service is shared
*
* @api
*/
- public function set($id, $service, $scope = self::SCOPE_CONTAINER)
+ public function set($id, $service, $shared = false)
{
$this->services[$id] = $service;
}
@@ -193,4 +199,9 @@ class phpbb_mock_container_builder implements ContainerInterface
{
return false;
}
+
+ public function initialized($id)
+ {
+ return true;
+ }
}
diff --git a/tests/mock/session_testable.php b/tests/mock/session_testable.php
index 2f24978ba8..7828a864d4 100644
--- a/tests/mock/session_testable.php
+++ b/tests/mock/session_testable.php
@@ -30,14 +30,14 @@ class phpbb_mock_session_testable extends \phpbb\session
/**
* Checks if the cookies were set correctly.
*
- * @param PHPUnit_Framework_Assert test The test from which this is called
+ * @param PHPUnit\Framework\Assert test The test from which this is called
* @param array(string => mixed) cookies The cookie data to check against.
* The keys are cookie names, the values can either be null to
- * check only the existance of the cookie, or an array(d, t),
+ * check only the existence of the cookie, or an array(d, t),
* where d is the cookie data to check, or null to skip the
* check and t is the cookie time to check, or null to skip.
*/
- public function check_cookies(PHPUnit_Framework_Assert $test, $cookies)
+ public function check_cookies(PHPUnit\Framework\Assert $test, $cookies)
{
$test->assertEquals(array_keys($cookies), array_keys($this->_cookies), 'Incorrect cookies were set');