diff options
Diffstat (limited to 'tests/mock/cache.php')
-rw-r--r-- | tests/mock/cache.php | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/mock/cache.php b/tests/mock/cache.php index 989180c256..c6d08afef0 100644 --- a/tests/mock/cache.php +++ b/tests/mock/cache.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2011 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ @@ -59,6 +59,21 @@ class phpbb_mock_cache implements phpbb_cache_driver_interface $test->assertEquals($data, $this->data[$var_name]); } + public function checkAssociativeVar(PHPUnit_Framework_Assert $test, $var_name, $data, $sort = true) + { + $test->assertTrue(isset($this->data[$var_name])); + + if ($sort) + { + foreach ($this->data[$var_name] as &$content) + { + sort($content); + } + } + + $test->assertEquals($data, $this->data[$var_name]); + } + public function checkVarUnset(PHPUnit_Framework_Assert $test, $var_name) { $test->assertFalse(isset($this->data[$var_name])); |