Neos\Flow\Tests\Unit\Package\PackageManagerTest::packageStatesConfigurationContainsRelativePaths PHP Method

packageStatesConfigurationContainsRelativePaths() public method

    public function packageStatesConfigurationContainsRelativePaths()
    {
        $packageKeys = ['RobertLemke.Flow.NothingElse' . md5(uniqid(mt_rand(), true)), 'Neos.Flow' . md5(uniqid(mt_rand(), true)), 'TYPO3.YetAnotherTestPackage' . md5(uniqid(mt_rand(), true))];
        foreach ($packageKeys as $packageKey) {
            $packagePath = 'vfs://Test/Packages/Application/' . $packageKey . '/';
            mkdir($packagePath, 0770, true);
            mkdir($packagePath . 'Classes');
            ComposerUtility::writeComposerManifest($packagePath, $packageKey, ['type' => 'flow-test', 'autoload' => []]);
        }
        $packageManager = $this->getAccessibleMock(PackageManager::class, ['updateShortcuts', 'emitPackageStatesUpdated'], [], '', false);
        $packageManager->_set('packagesBasePath', 'vfs://Test/Packages/');
        $packageManager->_set('packageStatesPathAndFilename', 'vfs://Test/Configuration/PackageStates.php');
        $packageFactory = new PackageFactory($packageManager);
        $this->inject($packageManager, 'packageFactory', $packageFactory);
        $packageManager->_set('packages', []);
        $actualPackageStatesConfiguration = $packageManager->rescanPackages();
        $expectedPackageStatesConfiguration = [];
        foreach ($packageKeys as $packageKey) {
            $composerName = ComposerUtility::getComposerPackageNameFromPackageKey($packageKey);
            $expectedPackageStatesConfiguration[$composerName] = ['state' => 'active', 'packagePath' => 'Application/' . $packageKey . '/', 'composerName' => $composerName, 'packageClassInformation' => [], 'packageKey' => $packageKey, 'autoloadConfiguration' => []];
        }
        $this->assertEquals($expectedPackageStatesConfiguration, $actualPackageStatesConfiguration['packages']);
    }