Neos\FluidAdaptor\Tests\Unit\ViewHelpers\FormViewHelperTest::csrfTokenFieldIsRenderedForUnsafeRequests PHP Method

csrfTokenFieldIsRenderedForUnsafeRequests() public method

    public function csrfTokenFieldIsRenderedForUnsafeRequests()
    {
        /** @var FormViewHelper|\PHPUnit_Framework_MockObject_MockObject $viewHelper */
        $viewHelper = $this->getAccessibleMock(\Neos\FluidAdaptor\ViewHelpers\FormViewHelper::class, null, array(), '', false);
        $this->injectDependenciesIntoViewHelper($viewHelper);
        $this->securityContext->expects($this->any())->method('isInitialized')->will($this->returnValue(true));
        $this->mockAuthenticationManager->expects($this->any())->method('isAuthenticated')->will($this->returnValue(true));
        $this->securityContext->expects($this->atLeastOnce())->method('getCsrfProtectionToken')->will($this->returnValue('CSRFTOKEN'));
        $this->assertEquals('<input type="hidden" name="__csrfToken" value="CSRFTOKEN" />' . chr(10), $viewHelper->_call('renderCsrfTokenField'));
    }
FormViewHelperTest