本文整理匯總了PHP中TYPO3\CMS\Core\Tests\AccessibleObjectInterface類的典型用法代碼示例。如果您正苦於以下問題:PHP AccessibleObjectInterface類的具體用法?PHP AccessibleObjectInterface怎麽用?PHP AccessibleObjectInterface使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了AccessibleObjectInterface類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: initializeObjectSetsRespectStoragePidToFalse
/**
* @test
*/
public function initializeObjectSetsRespectStoragePidToFalse()
{
$this->querySettings->expects($this->atLeastOnce())->method('setRespectStoragePage')->with(false);
$fixture = $this->getMock(\TYPO3\CMS\Belog\Domain\Repository\HistoryEntryRepository::class, array('setDefaultQuerySettings'), array($this->objectManager));
$fixture->expects($this->once())->method('setDefaultQuerySettings')->with($this->querySettings);
$fixture->initializeObject();
}
示例2: persistSessionTokenWritesTokensToSession
/**
* @test
*/
public function persistSessionTokenWritesTokensToSession()
{
$_SESSION['installToolFormToken'] = 'foo';
$this->subject->_set('sessionToken', '881ffea2159ac72182557b79dc0c723f5a8d20136f9fab56cdd4f8b3a1dbcfcd');
$this->subject->persistSessionToken();
$this->assertEquals('881ffea2159ac72182557b79dc0c723f5a8d20136f9fab56cdd4f8b3a1dbcfcd', $_SESSION['installToolFormToken']);
}
示例3: 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);
}
示例4: 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());
}
示例5: 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');
}
示例6: 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);
}
示例7: moduleDispatcherIsCalled
/**
* @test
* @expectedException \InvalidArgumentException
* @expectedExceptionCode 1425236663
*/
public function moduleDispatcherIsCalled()
{
$GLOBALS['TBE_MODULES'] = array('_PATHS' => array('module_fixture' => __DIR__ . '/../Fixtures/ModuleFixture/'));
$this->requestMock->expects($this->any())->method('getQueryParams')->will($this->returnValue(array('M' => 'module_fixture')));
$this->formProtectionMock->expects($this->once())->method('validateToken')->will($this->returnValue(true));
$this->subject->expects($this->once())->method('boot');
$this->subject->expects($this->atLeastOnce())->method('getFormProtection')->will($this->returnValue($this->formProtectionMock));
$this->subject->handleRequest($this->requestMock);
}
示例8: moduleDispatcherIsCalled
/**
* @test
* @expectedException \InvalidArgumentException
* @expectedExceptionCode 1425236663
*/
public function moduleDispatcherIsCalled()
{
$GLOBALS['TBE_MODULES'] = array('_PATHS' => array('_dispatcher' => array(), 'module_fixture' => __DIR__ . '/Fixtures/ModuleFixture/'));
$_GET['M'] = 'module_fixture';
$this->formProtectionMock->expects($this->once())->method('validateToken')->will($this->returnValue(TRUE));
$this->subject->expects($this->once())->method('boot');
$this->subject->expects($this->once())->method('getFormProtection')->will($this->returnValue($this->formProtectionMock));
$this->subject->handleRequest();
}
示例9: 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);
}
示例10: 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));
}
示例11: 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));
}
示例12: dispatchThrowsInvalidSlotExceptionIfObjectManagerOfSignalSlotDispatcherIsNotSet
/**
* @test
* @expectedException \TYPO3\CMS\Extbase\SignalSlot\Exception\InvalidSlotException
*/
public function dispatchThrowsInvalidSlotExceptionIfObjectManagerOfSignalSlotDispatcherIsNotSet()
{
$this->signalSlotDispatcher->_set('isInitialized', true);
$this->signalSlotDispatcher->_set('objectManager', null);
$this->signalSlotDispatcher->_set('slots', array('ClassA' => array('emitSomeSignal' => array(array()))));
$this->assertSame(null, $this->signalSlotDispatcher->dispatch('ClassA', 'emitSomeSignal'));
}
示例13: multipleExpressiosInWhereClauseAreBracedCorrectly
/**
* @test
*/
public function multipleExpressiosInWhereClauseAreBracedCorrectly()
{
$listMaxExpressions = 1000;
$mockSpecificsOci8 = $this->getAccessibleMock('TYPO3\\CMS\\Dbal\\Database\\Specifics\\Oci8', array(), array(), '', FALSE);
$mockSpecificsOci8->expects($this->any())->method('getSpecific')->will($this->returnValue($listMaxExpressions));
$INitems = range(0, 1250);
$NOTINItems = range(0, 1001);
$where = 'uid = 1981 AND uid IN(' . implode(',', $INitems) . ') OR uid = 42 AND uid NOT IN(' . implode(',', $NOTINItems) . ')';
$result = $this->subject->SELECTquery('uid, pid', 'tt_content', $where);
$chunks = array_chunk($INitems, $listMaxExpressions);
$INItemsWhereExpr = array();
foreach ($chunks as $chunk) {
$INItemsWhereExpr[] = '"uid" IN (' . implode(',', $chunk) . ')';
}
$chunks = array_chunk($NOTINItems, $listMaxExpressions);
$NOTINItemsWhereExpr = array();
foreach ($chunks as $chunk) {
$NOTINItemsWhereExpr[] = '"uid" NOT IN (' . implode(',', $chunk) . ')';
}
/**
* $expectedWhere:
* "uid" = 1981 AND (
* "uid" IN (1,2,3,4,...,1000)
* OR "uid" IN (1001,1002,...,1250)
* ) OR "uid" = 42 AND (
* "uid" NOT IN (1,2,3,4,...,1000)
* AND "uid" NOT IN (1001)
* )
*/
$expectedWhere = '"uid" = 1981 AND (' . implode(' OR ', $INItemsWhereExpr) . ') OR "uid" = 42 AND (' . implode(' AND ', $NOTINItemsWhereExpr) . ')';
$expectedQuery = 'SELECT "uid", "pid" FROM "tt_content" WHERE ' . $expectedWhere;
$this->assertEquals($expectedQuery, $this->cleanSql($result));
}
示例14: isClientValidationEnabledReturnsBool
/**
* Test for isClientValidationEnabled()
*
* @param array $settings
* @param bool $expectedNativeResult
* @param bool $expectedClientResult
* @return void
* @dataProvider isValidationEnabledReturnsBoolDataProvider
* @test
*/
public function isClientValidationEnabledReturnsBool($settings, $expectedNativeResult, $expectedClientResult)
{
unset($expectedNativeResult);
$this->abstractValidationViewHelperMock->_set('settings', $settings);
$result = $this->abstractValidationViewHelperMock->_callRef('isClientValidationEnabled');
$this->assertSame($expectedClientResult, $result);
}
示例15: renderReturnsArray
/**
* Test for render()
*
* @param array $settings
* @param array $fieldProperties
* @param array $additionalAttributes
* @param mixed $iteration
* @param array $expectedResult
* @return void
* @dataProvider renderReturnsArrayDataProvider
* @test
*/
public function renderReturnsArray($settings, $fieldProperties, $additionalAttributes, $iteration, $expectedResult)
{
$field = new Field();
foreach ($fieldProperties as $propertyName => $propertyValue) {
$field->_setProperty($propertyName, $propertyValue);
}
$this->abstractValidationViewHelperMock->_set('settings', $settings);
$this->abstractValidationViewHelperMock->_set('extensionName', 'powermail');
$controllerContext = new ControllerContext();
$request = new Request();
$request->setControllerExtensionName('powermail');
$controllerContext->setRequest($request);
$this->abstractValidationViewHelperMock->_set('controllerContext', $controllerContext);
$result = $this->abstractValidationViewHelperMock->_callRef('render', $field, $additionalAttributes, $iteration);
$this->assertSame($expectedResult, $result);
}