-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
MemoryTest.php
44 lines (36 loc) · 1.15 KB
/
MemoryTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
/**
* @see https://github.com/laminas/laminas-cache for the canonical source repository
* @copyright https://github.com/laminas/laminas-cache/blob/master/COPYRIGHT.md
* @license https://github.com/laminas/laminas-cache/blob/master/LICENSE.md New BSD License
*/
namespace LaminasTest\Cache\Storage\Adapter;
use Laminas\Cache;
/**
* @group Laminas_Cache
* @covers Laminas\Cache\Storage\Adapter\Memory<extended>
*/
class MemoryTest extends CommonAdapterTest
{
public function setUp()
{
// instantiate memory adapter
$this->_options = new Cache\Storage\Adapter\MemoryOptions();
$this->_storage = new Cache\Storage\Adapter\Memory();
$this->_storage->setOptions($this->_options);
parent::setUp();
}
public function getCommonAdapterNamesProvider()
{
return [
['memory'],
['Memory'],
];
}
public function testThrowOutOfSpaceException()
{
$this->_options->setMemoryLimit(memory_get_usage(true) - 8);
$this->expectException('Laminas\Cache\Exception\OutOfSpaceException');
$this->_storage->addItem('test', 'test');
}
}