diff options
| -rw-r--r-- | tests/cache/cache_memory.php | 20 | ||||
| -rw-r--r-- | tests/cache/cache_memory_test.php | 24 | ||||
| -rw-r--r-- | tests/cache/fixtures/cache_memory.xml | 8 | 
3 files changed, 25 insertions, 27 deletions
| diff --git a/tests/cache/cache_memory.php b/tests/cache/cache_memory.php index c468cb4658..806edb963a 100644 --- a/tests/cache/cache_memory.php +++ b/tests/cache/cache_memory.php @@ -1,15 +1,17 @@  <?php  /** -* -* @package testing -* @copyright (c) 2014 phpBB Group -* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 -* -*/ + * + * This file is part of the phpBB Forum Software package. + * + * @copyright (c) phpBB Limited <https://www.phpbb.com> + * @license GNU General Public License, version 2 (GPL-2.0) + * + * For full copyright and license information, please see + * the docs/CREDITS.txt file. + * + */ -require_once dirname(__FILE__) . '/../../phpBB/includes/acm/acm_memory.php'; - -class phpbb_cache_memory extends acm_memory +class phpbb_cache_memory extends \phpbb\cache\driver\memory  {  	protected $data = array(); diff --git a/tests/cache/cache_memory_test.php b/tests/cache/cache_memory_test.php index 7a529c1d04..9f92e8d8dc 100644 --- a/tests/cache/cache_memory_test.php +++ b/tests/cache/cache_memory_test.php @@ -1,17 +1,22 @@  <?php  /** -* -* @package testing -* @copyright (c) 2014 phpBB Group -* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 -* -*/ + * + * This file is part of the phpBB Forum Software package. + * + * @copyright (c) phpBB Limited <https://www.phpbb.com> + * @license GNU General Public License, version 2 (GPL-2.0) + * + * For full copyright and license information, please see + * the docs/CREDITS.txt file. + * + */  require_once dirname(__FILE__) . '/cache_memory.php';  class phpbb_cache_memory_test extends phpbb_database_test_case  {  	protected $cache; +	protected $db;  	public function getDataSet()  	{ @@ -25,6 +30,7 @@ class phpbb_cache_memory_test extends phpbb_database_test_case  		$this->cache = new phpbb_cache_memory();  		$db = $this->new_dbal(); +		$this->db = $db;  	}  	static public function cache_single_query_data() @@ -97,13 +103,11 @@ class phpbb_cache_memory_test extends phpbb_database_test_case  	*/  	public function test_cache_single_query($sql_queries, $table)  	{ -		global $db; -  		foreach ($sql_queries as $query)  		{ -			$sql_request_res = $db->sql_query($query[0]); +			$sql_request_res = $this->db->sql_query($query[0]); -			$this->cache->sql_save($query[0], $sql_request_res, 1); +			$this->cache->sql_save($this->db, $query[0], $sql_request_res, 1);  			$results = array();  			$query_id = $this->cache->sql_load($query[0]); diff --git a/tests/cache/fixtures/cache_memory.xml b/tests/cache/fixtures/cache_memory.xml index 6954c7b76b..9c19ebb7ba 100644 --- a/tests/cache/fixtures/cache_memory.xml +++ b/tests/cache/fixtures/cache_memory.xml @@ -49,8 +49,6 @@  		<column>username_clean</column>  		<column>user_permissions</column>  		<column>user_sig</column> -		<column>user_occ</column> -		<column>user_interests</column>  		<row>  			<value>1</value>  			<value>1</value> @@ -58,8 +56,6 @@  			<value>user 1</value>  			<value></value>  			<value></value> -			<value></value> -			<value></value>  		</row>  		<row>  			<value>2</value> @@ -68,8 +64,6 @@  			<value>user 2</value>  			<value></value>  			<value></value> -			<value></value> -			<value></value>  		</row>  		<row>  			<value>3</value> @@ -78,8 +72,6 @@  			<value>user 3</value>  			<value></value>  			<value></value> -			<value></value> -			<value></value>  		</row>  	</table>  </dataset> | 
