mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 22:10:45 +02:00
[ticket/9983] Split cache test into per-driver files.
PHPBB3-9983
This commit is contained in:
45
tests/cache/null_driver_test.php
vendored
Normal file
45
tests/cache/null_driver_test.php
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @package testing
|
||||
* @copyright (c) 2012 phpBB Group
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
||||
*
|
||||
*/
|
||||
|
||||
class phpbb_cache_null_driver_test extends phpbb_database_test_case
|
||||
{
|
||||
public function getDataSet()
|
||||
{
|
||||
return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config.xml');
|
||||
}
|
||||
|
||||
public function test_null_cache_sql()
|
||||
{
|
||||
$driver = new phpbb_cache_driver_null;
|
||||
|
||||
global $db, $cache;
|
||||
$db = $this->new_dbal();
|
||||
$cache = new phpbb_cache_service($driver);
|
||||
|
||||
$sql = "SELECT * FROM phpbb_config
|
||||
WHERE config_name = 'foo'";
|
||||
$result = $db->sql_query($sql, 300);
|
||||
$first_result = $db->sql_fetchrow($result);
|
||||
$expected = array('config_name' => 'foo', 'config_value' => '23', 'is_dynamic' => 0);
|
||||
$this->assertEquals($expected, $first_result);
|
||||
|
||||
$sql = 'DELETE FROM phpbb_config';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
// As null cache driver does not actually cache,
|
||||
// this should return no results
|
||||
$sql = "SELECT * FROM phpbb_config
|
||||
WHERE config_name = 'foo'";
|
||||
$result = $db->sql_query($sql, 300);
|
||||
|
||||
$this->assertSame(false, $db->sql_fetchrow($result));
|
||||
|
||||
$db->sql_close();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user