1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-04-13 20:32:11 +02:00

[ticket/11224] Updates tests

PHPBB3-11224
This commit is contained in:
Tristan Darricau 2014-10-01 15:13:31 +02:00
parent 8e638dbf6d
commit 5354c46e01
3 changed files with 25 additions and 27 deletions

View File

@ -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();

View File

@ -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]);

View File

@ -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>