/** * This method MUST be implemented by each driver to setup the `Cache` * instance for each test. * * This method should do the following tasks for each driver test: * * - Test the Cache instance driver is available, skip test otherwise * - Setup the Cache instance * - Call the parent setup method, `parent::setUp()` * * @return void */ public function setUp() { parent::setUp(); if (!extension_loaded('wincache')) { $this->markTestSkipped('Wincache PHP Extension is not available'); } $this->cache(Cache::instance('wincache')); }
/** * This method MUST be implemented by each driver to setup the `Cache` * instance for each test. * * This method should do the following tasks for each driver test: * * - Test the Cache instance driver is available, skip test otherwise * - Setup the Cache instance * - Call the parent setup method, `parent::setUp()` * * @return void */ public function setUp() { parent::setUp(); if (!extension_loaded('pdo_sqlite')) { $this->markTestSkipped('SQLite PDO PHP Extension is not available'); } $this->cache(Cache::instance('sqlite')); }
/** * This method MUST be implemented by each driver to setup the `Cache` * instance for each test. * * This method should do the following tasks for each driver test: * * - Test the Cache instance driver is available, skip test otherwise * - Setup the Cache instance * - Call the parent setup method, `parent::setUp()` * * @return void */ public function setUp() { parent::setUp(); if (!Kohana::$config->load('cache.file')) { Kohana::$config->load('cache')->set('file', array('driver' => 'file', 'cache_dir' => APPPATH . 'cache', 'default_expire' => 3600, 'ignore_on_delete' => array('file_we_want_to_keep.cache', '.gitignore', '.git', '.svn'))); } $this->cache(Cache::instance('file')); }
/** * This method MUST be implemented by each driver to setup the `Cache` * instance for each test. * * This method should do the following tasks for each driver test: * * - Test the Cache instance driver is available, skip test otherwise * - Setup the Cache instance * - Call the parent setup method, `parent::setUp()` * * @return void */ public function setUp() { parent::setUp(); if (!Kohana::$config->load('cache.file')) { $this->markTestSkipped('Unable to load File configuration'); } $this->cache(Cache::instance('file')); }
public function tearDown() { parent::tearDown(); // Cleanup $cache = $this->cache(); if ($cache instanceof Cache) { $cache->delete_all(); } }
/** * This method MUST be implemented by each driver to setup the `Cache` * instance for each test. * * This method should do the following tasks for each driver test: * * - Test the Cache instance driver is available, skip test otherwise * - Setup the Cache instance * - Call the parent setup method, `parent::setUp()` * * @return void */ public function setUp() { parent::setUp(); if (!extension_loaded('pdo_sqlite')) { $this->markTestSkipped('SQLite PDO PHP Extension is not available'); } if (!Kohana::$config->load('cache.sqlite')) { Kohana::$config->load('cache')->set('sqlite', array('driver' => 'sqlite', 'default_expire' => 3600, 'database' => 'memory', 'schema' => 'CREATE TABLE caches(id VARCHAR(127) PRIMARY KEY, tags VARCHAR(255), expiration INTEGER, cache TEXT)')); } $this->cache(Cache::instance('sqlite')); }
/** * This method MUST be implemented by each driver to setup the `Cache` * instance for each test. * * This method should do the following tasks for each driver test: * * - Test the Cache instance driver is available, skip test otherwise * - Setup the Cache instance * - Call the parent setup method, `parent::setUp()` * * @return void */ public function setUp() { parent::setUp(); if (!extension_loaded('pdo_sqlite')) { $this->markTestSkipped('SQLite PDO PHP Extension is not available'); } if (!Kohana::$config->load('cache.sqlite')) { $this->markTestIncomplete('Unable to load sqlite configuration'); } $this->cache(Cache::instance('sqlite')); }
/** * This method MUST be implemented by each driver to setup the `Cache` * instance for each test. * * This method should do the following tasks for each driver test: * * - Test the Cache instance driver is available, skip test otherwise * - Setup the Cache instance * - Call the parent setup method, `parent::setUp()` * * @return void */ public function setUp() { parent::setUp(); $this->cache(Cache::instance('file')); }