ApcCacheTest.php
978 Bytes
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
<?php
/*
* This file is part of the Assetic package, an OpenSky project.
*
* (c) 2010-2014 OpenSky Project Inc
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Assetic\Test\Cache;
use Assetic\Cache\ApcCache;
/**
* @group integration
*/
class ApcCacheTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!extension_loaded('apc') || !ini_get('apc.enable_cli')) {
$this->markTestSkipped('APC must be installed and the apc.enable_cli setting must be enabled.');
}
}
public function testCache()
{
$cache = new ApcCache();
$this->assertFalse($cache->has('foo'));
$cache->set('foo', 'bar');
$this->assertEquals('bar', $cache->get('foo'));
$this->assertTrue($cache->has('foo'));
$cache->remove('foo');
$this->assertFalse($cache->has('foo'));
}
}