Neos\Flow\Mvc\ActionRequest::setControllerPackageKey PHP Метод

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

This function tries to determine the correct case for the given package key. If the Package Manager does not know the specified package, the package key cannot be verified or corrected and is stored as is.
public setControllerPackageKey ( string $packageKey ) : void
$packageKey string The package key
Результат void
    public function setControllerPackageKey($packageKey)
    {
        $correctlyCasedPackageKey = $this->packageManager->getCaseSensitivePackageKey($packageKey);
        $this->controllerPackageKey = $correctlyCasedPackageKey !== false ? $correctlyCasedPackageKey : $packageKey;
    }

Usage Example

 /**
  * @test
  */
 public function setControllerPackageKeyWithLowercasePackageKeyResolvesCorrectly()
 {
     $mockPackageManager = $this->createMock(PackageManager::class);
     $mockPackageManager->expects($this->any())->method('getCaseSensitivePackageKey')->with('acme.testpackage')->will($this->returnValue('Acme.Testpackage'));
     $this->inject($this->actionRequest, 'packageManager', $mockPackageManager);
     $this->actionRequest->setControllerPackageKey('acme.testpackage');
     $this->assertEquals('Acme.Testpackage', $this->actionRequest->getControllerPackageKey());
 }
All Usage Examples Of Neos\Flow\Mvc\ActionRequest::setControllerPackageKey