[BUGFIX] Skip APC tests if on cli and enable_cli is off
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Tests / Unit / Cache / Backend / ApcBackendTest.php
index c3f774e..58fe5a6 100644 (file)
@@ -43,8 +43,8 @@ class ApcBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function setUp() {
                // Currently APCu identifies itself both as "apcu" and "apc" (for compatibility) although it doesn't provide the APC-opcache functionality
-               if (!extension_loaded('apc')) {
-                       $this->markTestSkipped('APC/APCu extension was not available');
+               if (!extension_loaded('apc') || ini_get('apc.enabled') == 0 || ini_get('apc.enable_cli') == 0) {
+                       $this->markTestSkipped('APC/APCu extension was not available, or it was disabled for CLI.');
                }
                if (ini_get('apc.slam_defense') == 1) {
                        $this->markTestSkipped('This testcase can only be executed with apc.slam_defense = Off');