Neos\Flow\Tests\Unit\Package\PackageFactoryTest::createReturnsInstanceOfCustomPackageIfItExists PHP Method

createReturnsInstanceOfCustomPackageIfItExists() public method

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