本文整理匯總了PHP中TYPO3\CMS\Core\Tests\AccessibleObjectInterface::_call方法的典型用法代碼示例。如果您正苦於以下問題:PHP AccessibleObjectInterface::_call方法的具體用法?PHP AccessibleObjectInterface::_call怎麽用?PHP AccessibleObjectInterface::_call使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TYPO3\CMS\Core\Tests\AccessibleObjectInterface
的用法示例。
在下文中一共展示了AccessibleObjectInterface::_call方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: createEntryFromRawDataSetsLinkIfPathIsGivenInEntryObject
/**
* @test
*/
public function createEntryFromRawDataSetsLinkIfPathIsGivenInEntryObject()
{
$rawModule = array('path' => 'pathTest');
/** @var $entry \TYPO3\CMS\Backend\Domain\Model\Module\BackendModule */
$entry = $this->moduleController->_call('createEntryFromRawData', $rawModule);
$this->assertEquals('pathTest', $entry->getLink());
}
示例2: previousNeighbourCanBeFound
/**
* @test
* @return void
*/
public function previousNeighbourCanBeFound()
{
$this->news->_setProperty('uid', 106);
$fo = $this->mockedViewHelper->_call('getNeighbours', $this->news, '', 'datetime');
$exp = [0 => ['uid' => 105, 'title' => NULL], 1 => ['uid' => 106, 'title' => NULL]];
$this->assertEquals($exp, $fo);
}
示例3: createValidationErrorMessageAddsErrorMessage
/**
* @test
* @deprecated since 6.2. Test can be removed if injectInstallTool method is dropped
*/
public function createValidationErrorMessageAddsErrorMessage()
{
$installTool = $this->getMock('stdClass', array('addErrorMessage'), array(), '', FALSE);
$installTool->expects($this->once())->method('addErrorMessage')->with('Validating the security token of this form has failed. ' . 'Please reload the form and submit it again.');
$this->fixture->injectInstallTool($installTool);
$this->fixture->_call('createValidationErrorMessage');
}
示例4: flattenResultDataValueFlattensFileAndFolderResourcesButReturnsAnythingElseAsIs
/**
* @test
*/
public function flattenResultDataValueFlattensFileAndFolderResourcesButReturnsAnythingElseAsIs()
{
$this->fileController = $this->getAccessibleMock('TYPO3\\CMS\\Backend\\Controller\\File\\FileController', array('dummy'));
$this->folderResourceMock->expects($this->once())->method('getIdentifier')->will($this->returnValue('bar'));
$this->mockFileProcessor->expects($this->any())->method('getErrorMessages')->will($this->returnValue(array()));
$this->assertTrue($this->fileController->_call('flattenResultDataValue', TRUE));
$this->assertSame(array(), $this->fileController->_call('flattenResultDataValue', array()));
$this->assertSame(array('id' => 'foo', 'date' => '29-11-73', 'iconClasses' => 't3-icon t3-icon-mimetypes t3-icon-mimetypes-text t3-icon-text-html'), $this->fileController->_call('flattenResultDataValue', $this->fileResourceMock));
$this->assertSame('bar', $this->fileController->_call('flattenResultDataValue', $this->folderResourceMock));
}
示例5: tokenFromSessionDataIsAvailableForValidateToken
/**
* @test
*/
public function tokenFromSessionDataIsAvailableForValidateToken()
{
$sessionToken = '881ffea2159ac72182557b79dc0c723f5a8d20136f9fab56cdd4f8b3a1dbcfcd';
$formName = 'foo';
$action = 'edit';
$formInstanceName = '42';
$tokenId = \TYPO3\CMS\Core\Utility\GeneralUtility::hmac($formName . $action . $formInstanceName . $sessionToken);
$_SESSION['installToolFormToken'] = $sessionToken;
$this->subject->_call('retrieveSessionToken');
$this->assertTrue($this->subject->validateToken($tokenId, $formName, $action, $formInstanceName));
}
示例6: configurationIsGeneratedCorrectlyFromRequest
/**
* @param array $requestArguments
* @param array $expectedConfiguration
* @param string $pid
* @test
* @dataProvider configurationDataProvider
*/
public function configurationIsGeneratedCorrectlyFromRequest(array $requestArguments, array $expectedConfiguration, $pid = '42')
{
$tsfeMock = $this->getMock('TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController', array(), array(), '', FALSE);
$tsfeMock->id = 42;
$tsfeMock->page = array('pid' => $pid);
$contextFixture = new RenderingContext($tsfeMock);
$requestFixture = new Request($requestArguments);
// This tests if the provided data makes sense
$this->assertTrue($this->renderer->canRender($requestFixture));
// Actual test
$this->assertSame($expectedConfiguration, $this->renderer->_call('resolveRenderingConfiguration', new Request($requestArguments), $contextFixture));
}
示例7: flattenResultDataValueFlattensFileAndFolderResourcesButReturnsAnythingElseAsIs
/**
* @test
*/
public function flattenResultDataValueFlattensFileAndFolderResourcesButReturnsAnythingElseAsIs()
{
$this->fileController = $this->getAccessibleMock(\TYPO3\CMS\Backend\Controller\File\FileController::class, array('dummy'));
$this->folderResourceMock->expects($this->once())->method('getIdentifier')->will($this->returnValue('bar'));
$this->mockFileProcessor->expects($this->any())->method('getErrorMessages')->will($this->returnValue(array()));
$this->assertTrue($this->fileController->_call('flattenResultDataValue', true));
$this->assertSame(array(), $this->fileController->_call('flattenResultDataValue', array()));
$result = $this->fileController->_call('flattenResultDataValue', $this->fileResourceMock);
$this->assertContains('<span class="t3js-icon icon icon-size-small icon-state-default icon-mimetypes-text-html" data-identifier="mimetypes-text-html">', $result['icon']);
unset($result['icon']);
$this->assertSame(array('id' => 'foo', 'date' => '29-11-73', 'thumbUrl' => ''), $result);
$this->assertSame('bar', $this->fileController->_call('flattenResultDataValue', $this->folderResourceMock));
}
示例8: configurationIsGeneratedCorrectlyFromRequest
/**
* @param array $requestArguments
* @param array $expectedConfiguration
* @param string $pageId
* @test
* @dataProvider configurationDataProvider
*/
public function configurationIsGeneratedCorrectlyFromRequest(array $requestArguments, array $expectedConfiguration, $pageId = '42')
{
$tsfeMock = $this->getMock('TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController', array(), array(), '', FALSE);
$pageRepositoryMock = $this->getMock('TYPO3\\CMS\\Frontend\\Page\\PageRepository');
$pageRepositoryMock->expects($this->any())->method('getRootLine')->willReturn(array(array('uid' => '1', 'pid' => '0')));
$tsfeMock->id = $pageId;
$tsfeMock->sys_page = $pageRepositoryMock;
$contextFixture = new RenderingContext($tsfeMock);
$requestFixture = new Request($requestArguments);
// This tests if the provided data makes sense
$this->assertTrue($this->renderer->canRender($requestFixture));
// Actual test
$this->assertSame($expectedConfiguration, $this->renderer->_call('resolveRenderingConfiguration', new Request($requestArguments), $contextFixture));
}
示例9: checkValue_checkReturnsExpectedValues
/**
* @param string $value
* @param string $expectedValue
*
* @dataProvider checkValue_checkReturnsExpectedValuesDataProvider
* @test
*/
public function checkValue_checkReturnsExpectedValues($value, $expectedValue)
{
$expectedResult = array('value' => $expectedValue);
$result = array();
$tcaFieldConfiguration = array('items' => array(array('Item 1', 0), array('Item 2', 0), array('Item 3', 0)));
$this->assertSame($expectedResult, $this->subject->_call('checkValueForCheck', $result, $value, $tcaFieldConfiguration, '', 0, 0, ''));
}
示例10: shouldFieldBeOverlaid
/**
* @test
* @dataProvider getShouldFieldBeOverlaidData
*/
public function shouldFieldBeOverlaid($field, $table, $value, $expected, $comment = '')
{
$GLOBALS['TCA']['fake_table']['columns'] = array('exclude' => array('l10n_mode' => 'exclude', 'config' => array('type' => 'input')), 'mergeIfNotBlank' => array('l10n_mode' => 'mergeIfNotBlank', 'config' => array('type' => 'input')), 'mergeIfNotBlank_group' => array('l10n_mode' => 'mergeIfNotBlank', 'config' => array('type' => 'group')), 'default' => array('config' => array('type' => 'input')), 'noCopy' => array('l10n_mode' => 'noCopy', 'config' => array('type' => 'input')), 'prefixLangTitle' => array('l10n_mode' => 'prefixLangTitle', 'config' => array('type' => 'input')));
$result = $this->pageSelectObject->_call('shouldFieldBeOverlaid', $table, $field, $value);
unset($GLOBALS['TCA']['fake_table']);
$this->assertSame($expected, $result, $comment);
}
示例11: getContextSpecificFrameworkConfigurationSetsDefaultRequestHandlersIfRequestHandlersAreNotConfigured
/**
* @test
*/
public function getContextSpecificFrameworkConfigurationSetsDefaultRequestHandlersIfRequestHandlersAreNotConfigured()
{
$frameworkConfiguration = array('pluginName' => 'Pi1', 'extensionName' => 'SomeExtension', 'foo' => array('bar' => array('baz' => 'Foo')));
$expectedResult = array('pluginName' => 'Pi1', 'extensionName' => 'SomeExtension', 'foo' => array('bar' => array('baz' => 'Foo')), 'mvc' => array('requestHandlers' => array(\TYPO3\CMS\Extbase\Mvc\Web\FrontendRequestHandler::class => \TYPO3\CMS\Extbase\Mvc\Web\FrontendRequestHandler::class, \TYPO3\CMS\Extbase\Mvc\Web\BackendRequestHandler::class => \TYPO3\CMS\Extbase\Mvc\Web\BackendRequestHandler::class)));
$actualResult = $this->backendConfigurationManager->_call('getContextSpecificFrameworkConfiguration', $frameworkConfiguration);
$this->assertEquals($expectedResult, $actualResult);
}
示例12: getOverrideDemandSettingsAddsValueIfFilled
/**
* @test
* @return void
*/
public function getOverrideDemandSettingsAddsValueIfFilled()
{
$flexform = [];
$this->addContentToFlexform($flexform, 'settings.disableOverrideDemand', '1', 'additional');
$this->pageLayoutView->_set('flexformData', $flexform);
$this->pageLayoutView->_call('getOverrideDemandSettings');
$this->assertEquals(count($this->pageLayoutView->_get('tableData')), 1);
}
示例13: initializeBasicErrorReportingExcludesDeprecated
/**
* @test
*/
public function initializeBasicErrorReportingExcludesDeprecated()
{
$backupReporting = error_reporting();
$this->fixture->_call('initializeBasicErrorReporting');
$actualReporting = error_reporting();
error_reporting($backupReporting);
$this->assertEquals(0, $actualReporting & E_DEPRECATED);
}
示例14: forceAbsoluteUrlReturnsCorrectAbsoluteUrlWithSubfolder
/**
* @test
*/
public function forceAbsoluteUrlReturnsCorrectAbsoluteUrlWithSubfolder()
{
// Force hostname and subfolder
$this->subject->expects($this->any())->method('getEnvironmentVariable')->will($this->returnValueMap(array(array('HTTP_HOST', 'localhost'), array('TYPO3_SITE_PATH', '/subfolder/'))));
$expected = 'http://localhost/subfolder/fileadmin/my.pdf';
$url = 'fileadmin/my.pdf';
$configuration = array('forceAbsoluteUrl' => '1');
$this->assertEquals($expected, $this->subject->_call('forceAbsoluteUrl', $url, $configuration));
}
示例15: getAllMessagesAndFlushClearsSessionStack
/**
* @test
*/
public function getAllMessagesAndFlushClearsSessionStack()
{
$flashMessage = new \TYPO3\CMS\Core\Messaging\FlashMessage('Transient', 'Title', \TYPO3\CMS\Core\Messaging\FlashMessage::OK, true);
$this->flashMessageQueue->enqueue($flashMessage);
$this->flashMessageQueue->getAllMessagesAndFlush();
/** @var $frontendUser \TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication */
$frontendUser = $this->flashMessageQueue->_call('getUserByContext');
$this->assertNull($frontendUser->getSessionData('core.template.flashMessages'));
}