mirror of
https://github.com/PGYER/codefever.git
synced 2026-05-08 14:36:58 +08:00
41 lines
779 B
PHP
Executable File
41 lines
779 B
PHP
Executable File
<?php
|
|
namespace Store;
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
use service\CacheData\Store;
|
|
|
|
class EmptyTest extends TestCase {
|
|
protected $store;
|
|
|
|
public function setUp()
|
|
{
|
|
$this->store = new Store();
|
|
}
|
|
|
|
public function testEmpty()
|
|
{
|
|
$data = [
|
|
'key1' => 'value1',
|
|
'key2' => 'value2',
|
|
'keyOther' => 'valueOther',
|
|
'key3' => [
|
|
'value3'
|
|
]
|
|
];
|
|
foreach ($data as $key => $value) {
|
|
$this->store->set($key, $value);
|
|
}
|
|
|
|
$this->store->empty();
|
|
$excepted = [];
|
|
$actual = $this->store->list();
|
|
|
|
$this->assertSame($excepted, $actual);
|
|
}
|
|
|
|
public function tearDown()
|
|
{
|
|
unset($this->store);
|
|
}
|
|
}
|