Skip to content

Commit 5837057

Browse files
mentalstringthePanz
authored andcommitted
Remove test dependency on APC
Replace the use of sfAPCCache with sfFileCache in sfCacheSessionStorageTest so that it doesn't depend on APC being available.
1 parent 5615daa commit 5837057

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

test/unit/storage/sfCacheSessionStorageTest.php

+10-7
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,14 @@
2020

2121
sfConfig::set('sf_symfony_lib_dir', realpath($_test_dir.'/../lib'));
2222

23+
// setup cache
24+
$temp = tempnam('/tmp/cache_dir', 'tmp');
25+
unlink($temp);
26+
mkdir($temp);
27+
2328
$plan = 8;
2429
$t = new lime_test($plan);
2530

26-
if (!ini_get('apc.enable_cli')) {
27-
$t->skip('APC must be enable on CLI to run these tests', $plan);
28-
29-
return;
30-
}
31-
3231
// initialize the storage
3332
try {
3433
$storage = new sfCacheSessionStorage();
@@ -37,7 +36,7 @@
3736
$t->pass('->__construct() throws an exception when not provided a cache option');
3837
}
3938

40-
$storage = new sfCacheSessionStorage(array('cache' => array('class' => 'sfAPCCache', 'param' => array())));
39+
$storage = new sfCacheSessionStorage(array('cache' => array('class' => 'sfFileCache', 'param' => array('cache_dir' => $temp))));
4140
$t->ok($storage instanceof sfStorage, '->__construct() is an instance of sfStorage');
4241

4342
$storage->write('test', 123);
@@ -63,3 +62,7 @@
6362

6463
// shutdown the storage
6564
$storage->shutdown();
65+
66+
// clean up cache
67+
sfToolkit::clearDirectory($temp);
68+
rmdir($temp);

0 commit comments

Comments
 (0)