本文整理匯總了PHP中TYPO3\CMS\Core\Tests\AccessibleObjectInterface::_set方法的典型用法代碼示例。如果您正苦於以下問題:PHP AccessibleObjectInterface::_set方法的具體用法?PHP AccessibleObjectInterface::_set怎麽用?PHP AccessibleObjectInterface::_set使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TYPO3\CMS\Core\Tests\AccessibleObjectInterface
的用法示例。
在下文中一共展示了AccessibleObjectInterface::_set方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: setUp
/**
* Sets up this testcase
*/
protected function setUp()
{
$GLOBALS['TYPO3_DB'] = $this->getMock(\TYPO3\CMS\Core\Database\DatabaseConnection::class, array());
$this->backendConfigurationManager = $this->getAccessibleMock(\TYPO3\CMS\Extbase\Configuration\BackendConfigurationManager::class, array('getTypoScriptSetup'));
$this->mockTypoScriptService = $this->getAccessibleMock(\TYPO3\CMS\Extbase\Service\TypoScriptService::class);
$this->backendConfigurationManager->_set('typoScriptService', $this->mockTypoScriptService);
}
示例2: addMockViewToFixture
/**
* Add a mock standalone view to fixture
*/
protected function addMockViewToFixture()
{
$this->standaloneView = $this->getMock('TYPO3\\CMS\\Fluid\\View\\StandaloneView');
$this->request = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Request');
$this->standaloneView->expects($this->any())->method('getRequest')->will($this->returnValue($this->request));
$this->fixture->_set('view', $this->standaloneView);
}
示例3: setUp
/**
* Sets up this testcase
*/
public function setUp()
{
$GLOBALS['TYPO3_DB'] = $this->getMock('TYPO3\\CMS\\Core\\Database\\DatabaseConnection', array());
$this->backendConfigurationManager = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Configuration\\BackendConfigurationManager', array('getTypoScriptSetup'));
$this->mockTypoScriptService = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Service\\TypoScriptService');
$this->backendConfigurationManager->_set('typoScriptService', $this->mockTypoScriptService);
}
示例4: setUp
/**
* Set up
*
* @return void
*/
protected function setUp()
{
// Mock system under test to make protected methods accessible
$this->configurationItemRepository = $this->getAccessibleMock(\TYPO3\CMS\Extensionmanager\Domain\Repository\ConfigurationItemRepository::class, array('dummy'));
$this->injectedObjectManagerMock = $this->getMock(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class, array(), array(), '', FALSE);
$this->configurationItemRepository->_set('objectManager', $this->injectedObjectManagerMock);
}
示例5: setUp
/**
* Set up
*/
public function setUp()
{
parent::setUp();
$this->viewHelper = $this->getAccessibleMock('Tx_MooxNews_ViewHelpers_SimplePrevNextViewHelper', array('dummy'));
$mockedDatabaseConnection = $this->getMock('TYPO3\\CMS\\Core\\Database\\DatabaseConnection', array('exec_SELECTgetSingleRow'));
$this->viewHelper->_set('databaseConnection', $mockedDatabaseConnection);
}
示例6: setUp
/**
* Set up
*/
public function setUp()
{
parent::setUp();
$this->viewHelper = $this->getAccessibleMock('GeorgRinger\\News\\ViewHelpers\\SimplePrevNextViewHelper', ['dummy']);
$mockedDatabaseConnection = $this->getMock('TYPO3\\CMS\\Core\\Database\\DatabaseConnection', ['exec_SELECTgetSingleRow']);
$this->viewHelper->_set('databaseConnection', $mockedDatabaseConnection);
}
示例7: persistSessionTokenWritesTokensToSession
/**
* @test
*/
public function persistSessionTokenWritesTokensToSession()
{
$_SESSION['installToolFormToken'] = 'foo';
$this->fixture->_set('sessionToken', '881ffea2159ac72182557b79dc0c723f5a8d20136f9fab56cdd4f8b3a1dbcfcd');
$this->fixture->persistSessionToken();
$this->assertEquals('881ffea2159ac72182557b79dc0c723f5a8d20136f9fab56cdd4f8b3a1dbcfcd', $_SESSION['installToolFormToken']);
}
示例8: addMockViewToSubject
/**
* Add a mock standalone view to subject
*/
protected function addMockViewToSubject()
{
$this->standaloneView = $this->getMock(\TYPO3\CMS\Fluid\View\StandaloneView::class, array(), array(), '', false);
$this->request = $this->getMock(\TYPO3\CMS\Extbase\Mvc\Request::class);
$this->standaloneView->expects($this->any())->method('getRequest')->will($this->returnValue($this->request));
$this->subject->_set('view', $this->standaloneView);
}
示例9: renderReturnsString
/**
* Test for render()
*
* @param string $validation
* @param string $expectedResult
* @param bool $nativeValidationEnabled
* @return void
* @dataProvider renderReturnsStringDataProvider
* @test
*/
public function renderReturnsString($validation, $expectedResult, $nativeValidationEnabled)
{
$this->abstractValidationViewHelperMock->_set('settings', ['validation' => ['native' => $nativeValidationEnabled ? '1' : '0']]);
$field = new Field();
$field->setValidation($validation);
$result = $this->abstractValidationViewHelperMock->_callRef('render', $field);
$this->assertSame($expectedResult, $result);
}
示例10: renderReturnsArray
/**
* Test for render()
*
* @param array $settings
* @param array $additionalAttributes
* @param array $expectedResult
* @return void
* @dataProvider renderReturnsArrayDataProvider
* @test
*/
public function renderReturnsArray($settings, $additionalAttributes, $expectedResult)
{
$form = new Form();
$form->_setProperty('uid', 123);
$this->enableParsleyAndAjaxViewHelperMock->_set('addRedirectUri', false);
$this->enableParsleyAndAjaxViewHelperMock->_set('settings', $settings);
$result = $this->enableParsleyAndAjaxViewHelperMock->_callRef('render', $form, $additionalAttributes);
$this->assertSame($expectedResult, $result);
}
示例11: renderReturnsArray
/**
* Test for render()
*
* @param array $settings
* @param array $fieldProperties
* @param array $additionalAttributes
* @param array $expectedResult
* @return void
* @dataProvider renderReturnsArrayDataProvider
* @test
*/
public function renderReturnsArray($settings, $fieldProperties, $additionalAttributes, $expectedResult)
{
$field = new Field();
foreach ($fieldProperties as $propertyName => $propertyValue) {
$field->_setProperty($propertyName, $propertyValue);
}
$this->abstractValidationViewHelperMock->_set('settings', $settings);
$result = $this->abstractValidationViewHelperMock->_callRef('render', $field, $additionalAttributes);
$this->assertSame($expectedResult, $result);
}
示例12: renderReturnsInt
/**
* Test for render()
*
* @param bool $extensionTableExists
* @param bool $isNewerVersionAvailable
* @param bool $currentVersionInExtensionTableExists
* @param bool $isCurrentVersionUnsecure
* @param int $expectedResult
* @return void
* @dataProvider renderReturnsIntDataProvider
* @test
*/
public function renderReturnsInt($extensionTableExists, $isNewerVersionAvailable, $currentVersionInExtensionTableExists, $isCurrentVersionUnsecure, $expectedResult)
{
$this->abstractValidationViewHelperMock->_set('checkFromDatabase', false);
$this->abstractValidationViewHelperMock->_callRef('setExtensionTableExists', $extensionTableExists);
$this->abstractValidationViewHelperMock->_callRef('setIsNewerVersionAvailable', $isNewerVersionAvailable);
$this->abstractValidationViewHelperMock->_callRef('setCurrentVersionInExtensionTableExists', $currentVersionInExtensionTableExists);
$this->abstractValidationViewHelperMock->_callRef('setIsCurrentVersionUnsecure', $isCurrentVersionUnsecure);
$result = $this->abstractValidationViewHelperMock->_callRef('render');
$this->assertSame($expectedResult, $result);
}
示例13: setUp
protected function setUp()
{
parent::setUp();
// Store all locale categories manipulated in tests for reconstruction in tearDown
$this->backupLocales = array('LC_COLLATE' => setlocale(LC_COLLATE, 0), 'LC_CTYPE' => setlocale(LC_CTYPE, 0), 'LC_MONETARY' => setlocale(LC_MONETARY, 0), 'LC_TIME' => setlocale(LC_TIME, 0));
$this->timezone = @date_default_timezone_get();
$GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'] = 'Y-m-d';
$this->subject = $this->getAccessibleMock(DateViewHelper::class, array('renderChildren'));
/** @var RenderingContext $renderingContext */
$renderingContext = $this->getMock(RenderingContext::class);
$this->subject->_set('renderingContext', $renderingContext);
}
示例14: updateRootlineDataWithInvalidNewRootlineThrowsException
/**
* @test
* @expectedException \RuntimeException
*/
public function updateRootlineDataWithInvalidNewRootlineThrowsException()
{
$originalRootline = array(0 => array('uid' => 2, 'title' => 'originalTitle'), 1 => array('uid' => 3, 'title' => 'originalTitle2'));
$newInvalidRootline = array(0 => array('uid' => 1, 'title' => 'newTitle'), 1 => array('uid' => 2, 'title' => 'newTitle2'));
$this->templateServiceMock->_set('rootLine', $originalRootline);
$this->templateServiceMock->updateRootlineData($newInvalidRootline);
}
示例15: setUp
/**
* Sets up this test case
*
* @return void
*/
protected function setUp()
{
$this->singletonInstances = GeneralUtility::getSingletonInstances();
$this->view = $this->getAccessibleMock(\TYPO3\CMS\Fluid\View\StandaloneView::class, array('testFileExistence', 'buildParserConfiguration'), array(), '', FALSE);
$this->mockTemplateParser = $this->getMock(TemplateParser::class);
$this->mockParsedTemplate = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\ParsedTemplateInterface::class);
$this->mockTemplateParser->expects($this->any())->method('parse')->will($this->returnValue($this->mockParsedTemplate));
$this->mockConfigurationManager = $this->getMock(ConfigurationManagerInterface::class);
$this->mockObjectManager = $this->getMock(\TYPO3\CMS\Extbase\Object\ObjectManager::class);
$this->mockObjectManager->expects($this->any())->method('get')->will($this->returnCallback(array($this, 'objectManagerCallback')));
$this->mockRequest = $this->getMock(Request::class);
$this->mockUriBuilder = $this->getMock(UriBuilder::class);
$this->mockContentObject = $this->getMock(\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::class);
$this->mockControllerContext = $this->getMock(ControllerContext::class);
$this->mockControllerContext->expects($this->any())->method('getRequest')->will($this->returnValue($this->mockRequest));
$this->mockViewHelperVariableContainer = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperVariableContainer::class);
$this->mockRenderingContext = $this->getMock(RenderingContext::class);
$this->mockRenderingContext->expects($this->any())->method('getControllerContext')->will($this->returnValue($this->mockControllerContext));
$this->mockRenderingContext->expects($this->any())->method('getViewHelperVariableContainer')->will($this->returnValue($this->mockViewHelperVariableContainer));
$this->view->_set('templateParser', $this->mockTemplateParser);
$this->view->_set('objectManager', $this->mockObjectManager);
$this->view->setRenderingContext($this->mockRenderingContext);
$this->mockTemplateCompiler = $this->getMock(TemplateCompiler::class);
$this->view->_set('templateCompiler', $this->mockTemplateCompiler);
GeneralUtility::setSingletonInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class, $this->mockObjectManager);
GeneralUtility::addInstance(\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::class, $this->mockContentObject);
$mockCacheManager = $this->getMock(\TYPO3\CMS\Core\Cache\CacheManager::class, array(), array(), '', FALSE);
$mockCache = $this->getMock(\TYPO3\CMS\Core\Cache\Frontend\PhpFrontend::class, array(), array(), '', FALSE);
$mockCacheManager->expects($this->any())->method('getCache')->will($this->returnValue($mockCache));
GeneralUtility::setSingletonInstance(\TYPO3\CMS\Core\Cache\CacheManager::class, $mockCacheManager);
}