Neos\Flow\Tests\Unit\Configuration\ConfigurationManagerTest::packageCachesCallback PHP Method

packageCachesCallback() public method

Callback for the above test.
    public function packageCachesCallback()
    {
        $filenameAndPath = func_get_arg(0);
        // We expect the following overriding order:
        // - $packageCaches
        // - $globalCaches
        // - $packageContextCaches
        // - $globalContextCaches
        // - $packageSubContextCaches
        // - $globalSubContextCaches
        $packageCaches = [\Neos_Flow_SomeCache::class => ['configPackageCaches' => 'correct', 'configGlobalCaches' => 'overriddenWronglyFromPackageCaches', 'configPackageContextCaches' => 'overriddenWronglyFromPackageCaches', 'configGlobalContextCaches' => 'overriddenWronglyFromPackageCaches', 'configPackageSubContextCaches' => 'overriddenWronglyFromPackageCaches', 'configGlobalSubContextCaches' => 'overriddenWronglyFromPackageCaches']];
        $globalCaches = [\Neos_Flow_SomeCache::class => ['configGlobalCaches' => 'correct', 'configPackageContextCaches' => 'overriddenWronglyFromGlobalCaches', 'configGlobalContextCaches' => 'overriddenWronglyFromGlobalCaches', 'configPackageSubContextCaches' => 'overriddenWronglyFromGlobalCaches', 'configGlobalSubContextCaches' => 'overriddenWronglyFromGlobalCaches']];
        $packageContextCaches = [\Neos_Flow_SomeCache::class => ['configPackageContextCaches' => 'correct', 'configGlobalContextCaches' => 'overriddenWronglyFromPackageContextCaches', 'configPackageSubContextCaches' => 'overriddenWronglyFromPackageContextCaches', 'configGlobalSubContextCaches' => 'overriddenWronglyFromPackageContextCaches']];
        $globalContextCaches = [\Neos_Flow_SomeCache::class => ['configGlobalContextCaches' => 'correct', 'configPackageSubContextCaches' => 'overriddenWronglyFromGlobalContextCaches', 'configGlobalSubContextCaches' => 'overriddenWronglyFromGlobalContextCaches']];
        $packageSubContextCaches = [\Neos_Flow_SomeCache::class => ['configPackageSubContextCaches' => 'correct', 'configGlobalSubContextCaches' => 'overriddenWronglyFromPackageSubContextCaches']];
        $globalSubContextCaches = [\Neos_Flow_SomeCache::class => ['configGlobalSubContextCaches' => 'correct']];
        switch ($filenameAndPath) {
            case 'Flow/Configuration/Caches':
                return $packageCaches;
            case 'Flow/Configuration/Testing/Caches':
                return $packageContextCaches;
            case 'Flow/Configuration/Testing/System1/Caches':
                return $packageSubContextCaches;
            case FLOW_PATH_CONFIGURATION . 'Caches':
                return $globalCaches;
            case FLOW_PATH_CONFIGURATION . 'Testing/Caches':
                return $globalContextCaches;
            case FLOW_PATH_CONFIGURATION . 'Testing/System1/Caches':
                return $globalSubContextCaches;
            default:
                throw new \Exception('Unexpected filename: ' . $filenameAndPath);
        }
    }
ConfigurationManagerTest