Neos\Flow\Tests\Unit\Package\PackageFactoryTest::createTakesAutoloaderTypeIntoAccountWhenLoadingCustomPackage PHP Метод

createTakesAutoloaderTypeIntoAccountWhenLoadingCustomPackage() публичный Метод

    public function createTakesAutoloaderTypeIntoAccountWhenLoadingCustomPackage()
    {
        $packagePath = 'vfs://Packages/Some/Path/Some.Package/';
        $packageFilePath = $packagePath . 'Classes/Package.php';
        mkdir(dirname($packageFilePath), 0777, true);
        $rawComposerManifest = '{"name": "some/package", "type": "neos-test", "autoload": { "psr-4": { "Foo": "bar" }}}';
        $composerManifest = json_decode($rawComposerManifest, true);
        file_put_contents($packagePath . 'composer.json', $rawComposerManifest);
        file_put_contents($packageFilePath, '<?php namespace Neos\\Flow\\Fixtures { class CustomPackage3 extends \\Neos\\Flow\\Package\\Package {}}');
        require $packageFilePath;
        $package = $this->packageFactory->create('vfs://Packages/', 'Some/Path/Some.Package/', 'Some.Package', 'some/package', $composerManifest['autoload']);
        $this->assertSame('Neos\\Flow\\Fixtures\\CustomPackage3', get_class($package));
    }