當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Tests\UnitTestCase類代碼示例

本文整理匯總了PHP中TYPO3\CMS\Core\Tests\UnitTestCase的典型用法代碼示例。如果您正苦於以下問題:PHP UnitTestCase類的具體用法?PHP UnitTestCase怎麽用?PHP UnitTestCase使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了UnitTestCase類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: 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

示例2: tearDown

 protected function tearDown()
 {
     if (!empty($this->extension) && $this->extension->getExtensionKey() != null) {
         GeneralUtility::rmdir($this->extension->getExtensionDir(), true);
     }
     parent::tearDown();
 }
開發者ID:TYPO3,項目名稱:extension_builder,代碼行數:7,代碼來源:BaseUnitTest.php

示例3: tearDown

 /**
  * @return void
  */
 public function tearDown()
 {
     foreach ($this->fakedExtensions as $extension => $dummy) {
         \TYPO3\CMS\Core\Utility\GeneralUtility::rmdir(PATH_site . 'typo3temp/' . $extension, TRUE);
     }
     parent::tearDown();
 }
開發者ID:samuweiss,項目名稱:TYPO3-Site,代碼行數:10,代碼來源:InstallUtilityTest.php

示例4: 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

示例5: tearDown

 /**
  * Tear down test case
  */
 public function tearDown()
 {
     foreach ($this->testFilesToDelete as $absoluteFileName) {
         \TYPO3\CMS\Core\Utility\GeneralUtility::unlink_tempfile($absoluteFileName);
     }
     parent::tearDown();
 }
開發者ID:samuweiss,項目名稱:TYPO3-Site,代碼行數:10,代碼來源:ConfigurationManagerTest.php

示例6: tearDown

 /**
  * @return void
  */
 protected function tearDown()
 {
     foreach ($this->fakedExtensions as $fakeExtkey => $fakeExtension) {
         $this->testFilesToDelete[] = PATH_site . 'typo3temp/' . $fakeExtkey;
     }
     parent::tearDown();
 }
開發者ID:rickymathew,項目名稱:TYPO3.CMS,代碼行數:10,代碼來源:InstallUtilityTest.php

示例7: tearDown

 /**
  * Tears down this test case.
  */
 protected function tearDown()
 {
     parent::tearDown();
     unset($this->elementProphecy);
     unset($this->objectManagerProphecy);
     unset($this->controllerContextProphecy);
 }
開發者ID:rickymathew,項目名稱:TYPO3.CMS,代碼行數:10,代碼來源:PostProcessorTest.php

示例8: tearDown

 /**
  * Explicitly clean up the indexer object to prevent any memory leaks
  */
 public function tearDown()
 {
     if ($this->temporaryFileName) {
         @unlink($this->temporaryFileName);
     }
     parent::tearDown();
 }
開發者ID:samuweiss,項目名稱:TYPO3-Site,代碼行數:10,代碼來源:IndexerTest.php

示例9: tearDown

 public function tearDown()
 {
     Utility\GeneralUtility::resetSingletonInstances($this->singletonInstances);
     foreach ($this->testFilesToDelete as $absoluteFileName) {
         Utility\GeneralUtility::rmdir($absoluteFileName, TRUE);
     }
     parent::tearDown();
 }
開發者ID:KarlDennisMatthaei1923,項目名稱:PierraaDesign,代碼行數:8,代碼來源:GeneralUtilityTest.php

示例10: tearDown

 /**
  * Cleans up the environment after running a test.
  */
 protected function tearDown()
 {
     // Restore locallangXMLOverride and localization format priority
     $GLOBALS['TYPO3_CONF_VARS']['SYS']['locallangXMLOverride'] = $this->locallangXMLOverride;
     $GLOBALS['TYPO3_CONF_VARS']['SYS']['lang']['format']['priority'] = $this->l10nPriority;
     \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Localization\LanguageStore::class)->initialize();
     parent::tearDown();
 }
開發者ID:plan2net,項目名稱:TYPO3.CMS,代碼行數:11,代碼來源:XliffParserTest.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: tearDown

 /**
  * Tear down
  *
  * @return void
  */
 protected function tearDown()
 {
     ExtensionManagementUtility::setPackageManager($this->backupPackageManager);
     if (file_exists(PATH_site . 'typo3temp/ExtensionCompatibilityTester.txt')) {
         unlink(PATH_site . 'typo3temp/ExtensionCompatibilityTester.txt');
     }
     parent::tearDown();
 }
開發者ID:rickymathew,項目名稱:TYPO3.CMS,代碼行數:13,代碼來源:ExtensionCompatibilityTesterTest.php

示例13: 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

示例14: 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

示例15: tearDown

 protected function tearDown()
 {
     foreach ($this->backupLocales as $category => $locale) {
         setlocale(constant($category), $locale);
     }
     date_default_timezone_set($this->timezone);
     parent::tearDown();
 }
開發者ID:vip3out,項目名稱:TYPO3.CMS,代碼行數:8,代碼來源:DateViewHelperTest.php


注:本文中的TYPO3\CMS\Core\Tests\UnitTestCase類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。