Neos\Flow\Tests\Unit\Core\ClassLoaderTest::classesFromPsr4PackagesAreLoaded PHP Метод

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

    public function classesFromPsr4PackagesAreLoaded()
    {
        $this->mockPackage1 = $this->getMockBuilder(Package::class)->disableOriginalConstructor()->getMock();
        $this->mockPackage1->expects($this->any())->method('getNamespaces')->will($this->returnValue(['Acme\\MyApp']));
        $this->mockPackage1->expects($this->any())->method('getPackagePath')->will($this->returnValue('vfs://Test/Packages/Application/Acme.MyApp/'));
        $this->mockPackage1->expects($this->any())->method('getFlattenedAutoloadConfiguration')->will($this->returnValue([['namespace' => 'Acme\\MyApp', 'classPath' => 'vfs://Test/Packages/Application/Acme.MyApp/Classes/', 'mappingType' => ClassLoader::MAPPING_TYPE_PSR4]]));
        mkdir('vfs://Test/Packages/Application/Acme.MyApp/Classes', 0770, true);
        file_put_contents('vfs://Test/Packages/Application/Acme.MyApp/Classes/Foo.php', '<?php ' . __CLASS__ . '::$testClassWasLoaded = TRUE; ?>');
        $this->mockPackages['Acme.MyApp'] = $this->mockPackage1;
        $this->classLoader->setPackages($this->mockPackages);
        $this->classLoader->loadClass('Acme\\MyApp\\Foo');
        $this->assertTrue(self::$testClassWasLoaded);
    }