D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
psa
/
admin
/
plib
/
modules
/
catalog
/
vendor
/
tedivm
/
stash
/
tests
/
Stash
/
Test
/
Driver
/
Filename :
SqliteAnyTest.php
back
Copy
<?php /* * This file is part of the Stash package. * * (c) Robert Hafner <tedivm@tedivm.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PleskCatalog\Stash\Test\Driver; use PleskCatalog\Stash\Test\Stubs\PoolGetDriverStub; use PleskCatalog\Stash\Driver\Sqlite; use PleskCatalog\Stash\Item; use PleskCatalog\Stash\Pool; use PleskCatalog\Stash\Utilities; /** * @package Stash * @author Robert Hafner <tedivm@tedivm.com> */ class SqliteAnyTest extends \PleskCatalog\PHPUnit\Framework\TestCase { protected $driverClass = 'PleskCatalog\\Stash\\Driver\\Sqlite'; protected function setUp() : void { $driverClass = $this->driverClass; if (!$driverClass::isAvailable()) { $this->markTestSkipped('Driver class unsuited for current environment'); return; } } public function testConstruction() { $key = array('apple', 'sauce'); $driver = new Sqlite(array()); $pool = new Pool(); $pool->setDriver($driver); $item = $pool->getItem('testKey'); $item->set($key); $this->assertTrue($pool->save($item), 'Able to load and store with unconfigured extension.'); } public function testNesting() { $key = array('apple', 'sauce'); $driver = new Sqlite(array('nesting' => 3)); $pool = new Pool(); $pool->setDriver($driver); $item = $pool->getItem('testKey'); $item->set($key); $this->assertTrue($pool->save($item), 'Able to load and store with nesting level 3.'); } public static function tearDownAfterClass() : void { Utilities::deleteRecursive(Utilities::getBaseDirectory()); } }