aboutsummaryrefslogtreecommitdiffstats
path: root/tests/cache/null_driver_test.php
diff options
context:
space:
mode:
authorMaat <maat-pub@mageia.biz>2020-05-08 21:52:11 +0200
committerMaat <maat-pub@mageia.biz>2020-05-08 21:52:11 +0200
commit8ea437e30605e0f66b5220bf904a61d7c1d11ddd (patch)
treee0db2bb4a012d5b06a633160b19f62f4868ecd28 /tests/cache/null_driver_test.php
parent36bc1870f21fac04736a1049c1d5b8e127d729f4 (diff)
parent2fdd46b36431ae0f58bb2e78e42553168db9a0ff (diff)
downloadforums-8ea437e30605e0f66b5220bf904a61d7c1d11ddd.tar
forums-8ea437e30605e0f66b5220bf904a61d7c1d11ddd.tar.gz
forums-8ea437e30605e0f66b5220bf904a61d7c1d11ddd.tar.bz2
forums-8ea437e30605e0f66b5220bf904a61d7c1d11ddd.tar.xz
forums-8ea437e30605e0f66b5220bf904a61d7c1d11ddd.zip
Merge remote-tracking branch 'upstream/prep-release-3.2.9'
Diffstat (limited to 'tests/cache/null_driver_test.php')
-rw-r--r--tests/cache/null_driver_test.php77
1 files changed, 0 insertions, 77 deletions
diff --git a/tests/cache/null_driver_test.php b/tests/cache/null_driver_test.php
deleted file mode 100644
index b9f96732f5..0000000000
--- a/tests/cache/null_driver_test.php
+++ /dev/null
@@ -1,77 +0,0 @@
-<?php
-/**
-*
-* 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.
-*
-*/
-
-class phpbb_cache_null_driver_test extends phpbb_database_test_case
-{
- protected $driver;
-
- public function getDataSet()
- {
- return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config.xml');
- }
-
- protected function setUp()
- {
- parent::setUp();
-
- $this->driver = new \phpbb\cache\driver\null;
- }
-
- public function test_get_put()
- {
- $this->assertSame(false, $this->driver->get('key'));
-
- $this->driver->put('key', 'value');
-
- // null driver does not cache
- $this->assertSame(false, $this->driver->get('key'));
- }
-
- public function test_purge()
- {
- $this->assertNull($this->driver->purge());
- }
-
- public function test_destroy()
- {
- $this->assertNull($this->driver->destroy('foo'));
- }
-
- public function test_cache_sql()
- {
- global $db, $cache, $phpbb_root_path, $phpEx;
- $config = new phpbb\config\config(array());
- $db = $this->new_dbal();
- $cache = new \phpbb\cache\service($this->driver, $config, $db, $phpbb_root_path, $phpEx);
-
- $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();
- }
-}