codeception/module-apc
Codeception APC module adds caching support to your tests by integrating PHP’s APC/APCu. Clear, inspect, and manage cache entries during functional and acceptance runs to keep suites isolated and predictable.
This package is a legacy module for Codeception to interact with PHP's deprecated APC (Alternative PHP Cache) extension. Since APC was deprecated in PHP 5.5 and removed entirely in PHP 7.0, this module is only relevant for testing very old PHP codebases still running on PHP 5.x. To begin:
apc extension enabled (extension=apc.so or extension=apc.dll).composer require --dev codeception/module-apccodeception.yml or suite config:
modules:
enabled:
- APC
$I->amInCache(); $I->haveInCache('key', 'value'); $I->clearCache();$I->haveInCache($key, $value, $ttl) before your SUT (System Under Test) runs.$I->seeInCache('user_session_123');
$I->dontSeeInCache('expired_token');
$I->grabFromCache('config_key'); // returns value or null
Helper\Actor methods to abstract cache seeding, e.g., setupTestUserDataInCache() for user-facing tests.codeception/module-redis or codeception/module-memcached instead.apc_* functions), not APCu. APCu lacks the opcode caching parts, but this module only works with APC’s user cache API.apc.enable_cli=1 in php.ini, or you’ll get empty cache — leading to false-negative assertions.function_exists('apcu_*'), this module won’t help — it doesn’t simulate APCu or fall back to filesystem caching.$I->debugSection('APC', print_r(apc_cache_info('user'), true)); inside a test to inspect real-time APC stats.How can I help you explore Laravel packages today?