Neos\FluidAdaptor\Tests\Unit\ViewHelpers\Form\SelectViewHelperTest::selectWithoutFurtherConfigurationOnDomainObjectsUsesUuidForValueAndLabel PHP Метод

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

    public function selectWithoutFurtherConfigurationOnDomainObjectsUsesUuidForValueAndLabel()
    {
        $mockPersistenceManager = $this->createMock(\Neos\Flow\Persistence\PersistenceManagerInterface::class);
        $mockPersistenceManager->expects($this->any())->method('getIdentifierByObject')->will($this->returnValue('fakeUUID'));
        $this->viewHelper->injectPersistenceManager($mockPersistenceManager);
        $this->tagBuilder->expects($this->once())->method('addAttribute')->with('name', 'myName');
        $this->viewHelper->expects($this->once())->method('registerFieldNameForFormTokenGeneration')->with('myName');
        $this->tagBuilder->expects($this->once())->method('setContent')->with('<option value="fakeUUID">fakeUUID</option>' . chr(10));
        $this->tagBuilder->expects($this->once())->method('render');
        $user = new \Neos\FluidAdaptor\ViewHelpers\Fixtures\UserDomainClass(1, 'Ingmar', 'Schlecht');
        $this->arguments['options'] = array($user);
        $this->arguments['name'] = 'myName';
        $this->injectDependenciesIntoViewHelper($this->viewHelper);
        $this->viewHelper->initialize();
        $this->viewHelper->render();
    }