本文整理匯總了PHP中TYPO3\CMS\Core\Tests\AccessibleObjectInterface::initialize方法的典型用法代碼示例。如果您正苦於以下問題:PHP AccessibleObjectInterface::initialize方法的具體用法?PHP AccessibleObjectInterface::initialize怎麽用?PHP AccessibleObjectInterface::initialize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TYPO3\CMS\Core\Tests\AccessibleObjectInterface
的用法示例。
在下文中一共展示了AccessibleObjectInterface::initialize方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: createFakeExtension
/**
* Creates a fake extension with a given table definition.
*
* @param string $tableDefinition SQL script to create the extension's tables
* @throws \RuntimeException
* @return void
*/
protected function createFakeExtension($tableDefinition)
{
// Prepare a fake extension configuration
$ext_tables = GeneralUtility::tempnam('ext_tables');
if (!GeneralUtility::writeFile($ext_tables, $tableDefinition)) {
throw new \RuntimeException('Can\'t write temporary ext_tables file.');
}
$this->temporaryFiles[] = $ext_tables;
$GLOBALS['TYPO3_LOADED_EXT'] = array('test_dbal' => array('ext_tables.sql' => $ext_tables));
// Append our test table to the list of existing tables
$this->subject->initialize();
}
示例2: standardTagAttributesAreRegistered
/**
* @test
*/
public function standardTagAttributesAreRegistered()
{
$mockTagBuilder = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder', array('addAttribute'), array(), '', FALSE);
$mockTagBuilder->expects($this->at(0))->method('addAttribute')->with('class', 'classAttribute');
$mockTagBuilder->expects($this->at(1))->method('addAttribute')->with('dir', 'dirAttribute');
$mockTagBuilder->expects($this->at(2))->method('addAttribute')->with('id', 'idAttribute');
$mockTagBuilder->expects($this->at(3))->method('addAttribute')->with('lang', 'langAttribute');
$mockTagBuilder->expects($this->at(4))->method('addAttribute')->with('style', 'styleAttribute');
$mockTagBuilder->expects($this->at(5))->method('addAttribute')->with('title', 'titleAttribute');
$mockTagBuilder->expects($this->at(6))->method('addAttribute')->with('accesskey', 'accesskeyAttribute');
$mockTagBuilder->expects($this->at(7))->method('addAttribute')->with('tabindex', 'tabindexAttribute');
$this->viewHelper->_set('tag', $mockTagBuilder);
$arguments = array('class' => 'classAttribute', 'dir' => 'dirAttribute', 'id' => 'idAttribute', 'lang' => 'langAttribute', 'style' => 'styleAttribute', 'title' => 'titleAttribute', 'accesskey' => 'accesskeyAttribute', 'tabindex' => 'tabindexAttribute');
$this->viewHelper->_call('registerUniversalTagAttributes');
$this->viewHelper->setArguments($arguments);
$this->viewHelper->initializeArguments();
$this->viewHelper->initialize();
}
示例3: renderSetsCheckedAttributeForListOfObjects
/**
* @test
*/
public function renderSetsCheckedAttributeForListOfObjects()
{
$mockTagBuilder = $this->getMock(TagBuilder::class, array('setTagName', 'addAttribute'));
$mockTagBuilder->expects($this->at(1))->method('addAttribute')->with('type', 'checkbox');
$mockTagBuilder->expects($this->at(2))->method('addAttribute')->with('name', 'foo[]');
$mockTagBuilder->expects($this->at(3))->method('addAttribute')->with('value', 2);
$mockTagBuilder->expects($this->at(4))->method('addAttribute')->with('checked', 'checked');
$object1 = new \stdClass();
$object2 = new \stdClass();
$object3 = new \stdClass();
$this->viewHelper->expects($this->any())->method('getName')->willReturn('foo');
$this->viewHelper->expects($this->any())->method('getValueAttribute')->willReturn(2);
$this->viewHelper->expects($this->any())->method('isObjectAccessorMode')->willReturn(true);
$this->viewHelper->expects($this->any())->method('getPropertyValue')->willReturn(array($object1, $object2, $object3));
$this->viewHelper->_set('tag', $mockTagBuilder);
$mockPersistenceManager = $this->getMock(PersistenceManagerInterface::class);
$mockPersistenceManager->expects($this->any())->method('getIdentifierByObject')->will($this->returnValueMap(array(array($object1, 1), array($object2, 2), array($object3, 3))));
$this->viewHelper->_set('persistenceManager', $mockPersistenceManager);
$this->viewHelper->initialize();
$this->viewHelper->render();
}