当前位置: 首页>>代码示例>>PHP>>正文


PHP UnitTestCase::setUp方法代码示例

本文整理汇总了PHP中TYPO3\CMS\Core\Tests\UnitTestCase::setUp方法的典型用法代码示例。如果您正苦于以下问题:PHP UnitTestCase::setUp方法的具体用法?PHP UnitTestCase::setUp怎么用?PHP UnitTestCase::setUp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TYPO3\CMS\Core\Tests\UnitTestCase的用法示例。


在下文中一共展示了UnitTestCase::setUp方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setUp

 /**
  * Sets up this test case.
  */
 protected function setUp()
 {
     parent::setUp();
     $this->elementProphecy = $this->prophesize(Element::class);
     $this->objectManagerProphecy = $this->prophesize(ObjectManager::class);
     $this->controllerContextProphecy = $this->prophesize(ControllerContext::class);
 }
开发者ID:rickymathew,项目名称:TYPO3.CMS,代码行数:10,代码来源:PostProcessorTest.php

示例2: setUp

 public function setUp()
 {
     parent::setUp();
     $this->errorHandlerMock = $this->getMock('R3H6\\Error404page\\Domain\\Handler\\ErrorHandler', array('handleError'), array(), '', false);
     $this->subject = $this->getMock('R3H6\\Error404page\\Domain\\Hook\\ErrorHandlerHook', array('getErrorHandler', 'getSystemLanguage'), array(), '', false);
     $this->subject->expects($this->any())->method('getErrorHandler')->will($this->returnValue($this->errorHandlerMock));
 }
开发者ID:r3h6,项目名称:TYPO3.EXT.error404page,代码行数:7,代码来源:ErrorHandlerHookTest.php

示例3: setUp

 /**
  * Create a new database connection mock object for every test.
  *
  * @return void
  */
 protected function setUp()
 {
     parent::setUp();
     $this->connection = $this->getMockBuilder(Connection::class)->disableOriginalConstructor()->getMock();
     $this->connection->expects($this->any())->method('quoteIdentifier')->will($this->returnArgument(0));
     $this->connection->expects($this->any())->method('getDatabasePlatform')->will($this->returnValue(new MockPlatform()));
 }
开发者ID:dachcom-digital,项目名称:TYPO3.CMS,代码行数:12,代码来源:BulkInsertTest.php

示例4: setUp

 public function setUp()
 {
     parent::setUp();
     $this->subject = new ErrorHandlerCache();
     $this->frontendUserMock = $this->getMock('R3H6\\Error404page\\Facade\\FrontendUser', get_class_methods('R3H6\\Error404page\\Facade\\FrontendUser'), array(), '', false);
     $this->inject($this->subject, 'frontendUser', $this->frontendUserMock);
 }
开发者ID:r3h6,项目名称:TYPO3.EXT.error404page,代码行数:7,代码来源:ErrorHandlerCacheTest.php

示例5: setUp

 /**
  * Sets up this test case.
  */
 protected function setUp()
 {
     parent::setUp();
     $this->typoScriptRepositoryProphecy = $this->prophesize(TypoScriptRepository::class);
     $this->subject = $this->getAccessibleMock(Configuration::class, array('__none'));
     $this->subject->_set('typoScriptRepository', $this->typoScriptRepositoryProphecy->reveal());
 }
开发者ID:TYPO3Incubator,项目名称:TYPO3.CMS,代码行数:10,代码来源:ConfigurationTest.php

示例6: setUp

 /**
  * Create a new database connection mock object for every test.
  *
  * @return void
  */
 protected function setUp()
 {
     parent::setUp();
     $this->typoScriptFrontendController = $this->prophesize(TypoScriptFrontendController::class);
     $GLOBALS['TSFE'] = $this->typoScriptFrontendController->reveal();
     $this->subject = GeneralUtility::makeInstance(QueryContext::class);
 }
开发者ID:dachcom-digital,项目名称:TYPO3.CMS,代码行数:12,代码来源:QueryContextTest.php

示例7: setUp

 /**
  * Sets environment variables and initializes global mock object.
  */
 protected function setUp()
 {
     parent::setUp();
     $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'] = '12345';
     $this->jumpUrlHandler = $this->getMock(JumpUrlHandler::class, array('isLocationDataValid', 'getResourceFactory', 'getTypoScriptFrontendController', 'readFileAndExit', 'redirect'));
     $this->tsfe = $this->getAccessibleMock(TypoScriptFrontendController::class, array('getPagesTSconfig'), array(), '', false);
     $this->jumpUrlHandler->expects($this->any())->method('getTypoScriptFrontendController')->will($this->returnValue($this->tsfe));
 }
开发者ID:hlop,项目名称:TYPO3.CMS,代码行数:11,代码来源:JumpUrlHandlerTest.php

示例8: setUp

 /**
  * Create a new database connection mock object for every test.
  *
  * @return void
  */
 protected function setUp()
 {
     parent::setUp();
     $this->concreteQueryBuilder = $this->prophesize(\Doctrine\DBAL\Query\QueryBuilder::class);
     $this->connection = $this->prophesize(Connection::class);
     $this->connection->getDatabasePlatform()->willReturn(new MockPlatform());
     $this->subject = GeneralUtility::makeInstance(QueryBuilder::class, $this->connection->reveal(), null, $this->concreteQueryBuilder->reveal());
 }
开发者ID:dachcom-digital,项目名称:TYPO3.CMS,代码行数:13,代码来源:QueryBuilderTest.php

示例9: setUp

 public 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';
 }
开发者ID:KarlDennisMatthaei1923,项目名称:PierraaDesign,代码行数:8,代码来源:DateViewHelperTest.php

示例10: setUp

 /**
  * Create a new database connection mock object for every test.
  *
  * @return void
  */
 protected function setUp()
 {
     parent::setUp();
     /** @var Connection|ObjectProphecy $connectionProphet */
     $this->connectionProphet = $this->prophesize(Connection::class);
     $this->connectionProphet->quoteIdentifier(Argument::cetera())->willReturnArgument(0);
     $this->subject = new ExpressionBuilder($this->connectionProphet->reveal());
 }
开发者ID:dachcom-digital,项目名称:TYPO3.CMS,代码行数:13,代码来源:ExpressionBuilderTest.php

示例11: setUp

 /**
  * Create a new database connection mock object for every test.
  *
  * @return void
  */
 protected function setUp()
 {
     parent::setUp();
     $this->connection = $this->getMockBuilder(Connection::class)->disableOriginalConstructor()->setMethods(['connect', 'executeQuery', 'executeUpdate', 'getDatabasePlatform', 'getDriver', 'getExpressionBuilder', 'getWrappedConnection'])->getMock();
     $this->connection->expects($this->any())->method('getExpressionBuilder')->will($this->returnValue(GeneralUtility::makeInstance(ExpressionBuilder::class, $this->connection)));
     $this->connection->expects($this->any())->method('connect');
     $this->connection->expects($this->any())->method('getDatabasePlatform')->will($this->returnValue(new MockPlatform()));
 }
开发者ID:dachcom-digital,项目名称:TYPO3.CMS,代码行数:13,代码来源:ConnectionTest.php

示例12: setUp

 public function setUp()
 {
     parent::setUp();
     $languageService = $this->getMock('TYPO3\\CMS\\Core\\Utility\\GeneralUtility\\LanguageService', array('sL'));
     $languageService->expects($this->any())->method('sL')->will($this->returnValue('any language'));
     $GLOBALS['LANG'] = $languageService;
     $this->cmsLayout = $this->getAccessibleMock('Tx_MooxNews_Hooks_CmsLayout', array('dummy'));
     $this->cmsLayout->_set('databaseConnection', $this->getMock('TYPO3\\CMS\\Core\\Utility\\GeneralUtility\\DatabaseConnection', array('exec_SELECTquery', 'exec_SELECTgetRows')));
 }
开发者ID:preinboth,项目名称:moox_news,代码行数:9,代码来源:CmsLayoutTest.php

示例13: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->mockContentObject = $this->getMock(ContentObjectRenderer::class, array(), array(), '', false);
     $this->viewHelper = $this->getMock(\TYPO3\CMS\Fluid\ViewHelpers\Format\CropViewHelper::class, array('renderChildren'));
     $renderingContext = $this->getMock(\TYPO3\CMS\Fluid\Tests\Unit\Core\Rendering\RenderingContextFixture::class);
     $this->viewHelper->setRenderingContext($renderingContext);
     $this->viewHelper->expects($this->once())->method('renderChildren')->will($this->returnValue('Some Content'));
 }
开发者ID:TYPO3Incubator,项目名称:TYPO3.CMS,代码行数:9,代码来源:CropViewHelperTest.php

示例14: setUp

 /**
  * Set up the test
  */
 protected function setUp()
 {
     parent::setUp();
     /** @var VimeoHelper|\PHPUnit_Framework_MockObject_MockObject $vimeoHelper */
     $vimeoHelper = $this->getAccessibleMock(VimeoHelper::class, array('getOnlineMediaId'), array('vimeo'));
     $vimeoHelper->expects($this->any())->method('getOnlineMediaId')->will($this->returnValue('7331'));
     $this->subject = $this->getAccessibleMock(VimeoRenderer::class, array('getOnlineMediaHelper'), array());
     $this->subject->expects($this->any())->method('getOnlineMediaHelper')->will($this->returnValue($vimeoHelper));
 }
开发者ID:rickymathew,项目名称:TYPO3.CMS,代码行数:12,代码来源:VimeoRendererTest.php

示例15: setUp

 public function setUp()
 {
     parent::setUp();
     $languageService = $this->getMock('TYPO3\\CMS\\Core\\Utility\\GeneralUtility\\LanguageService', ['sL']);
     $languageService->expects($this->any())->method('sL')->will($this->returnValue('any language'));
     $GLOBALS['LANG'] = $languageService;
     $this->pageLayoutView = $this->getAccessibleMock('GeorgRinger\\News\\Hooks\\PageLayoutView', ['dummy']);
     $this->pageLayoutView->_set('databaseConnection', $this->getMock('TYPO3\\CMS\\Core\\Utility\\GeneralUtility\\DatabaseConnection', ['exec_SELECTquery', 'exec_SELECTgetRows']));
 }
开发者ID:BastianBalthasarBux,项目名称:news,代码行数:9,代码来源:PageLayoutViewTest.php


注:本文中的TYPO3\CMS\Core\Tests\UnitTestCase::setUp方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。