TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
FunctionalTestCase Class Reference
Inheritance diagram for FunctionalTestCase:
BaseTestCase LocalizationControllerTest Typo3DatabaseBackendTest CategoryCollectionTest RecordCollectionRepositoryTest DatabaseConnectionTest PreparedStatementTest SchemaMigratorTest AbstractDataHandlerActionTestCase GetUniqueTest DatabaseWriterTest FlashMessageQueueTest PageRendererTest RegistryTest ResourceStorageTest TypoScriptParserTest BackendGroupsVisibleFieldsTest BackendUsersVisibleFieldsTest CategoryVisibleFieldsTest CollectionVisibleFieldsTest FileCollectionVisibleFieldsTest FileMetadataVisibleFieldsTest FilemountsVisibleFieldsTest FileStorageVisibleFieldsTest LanguageVisibleFieldsTest NewsVisibleFieldsTest PagesLanguageOverlayVisibleFieldsTest PagesVisibleFieldsTest ContentVisibleFieldsTest BackendConfigurationManagerTest AddTest CountTest DataMapperTest InTest OperatorTest QueryParserTest RelationTest TranslationTest ContentVisibleFieldsTest FileMetadataVisibleFieldsTest ContentVisibleFieldsTest ContentObjectRendererTest FluidTemplateContentObjectTest TypoScriptFrontendControllerTest PageRepositoryTest BackendLayoutVisibleFieldsTest ContentVisibleFieldsTest DomainVisibleFieldsTest FrontendGroupsVisibleFieldsTest FrontendUsersVisibleFieldsTest TemplateVisibleFieldsTest AbstractExportTestCase IndexConfigVisibleFieldsTest LikeWildcardTest SqlSchemaMigrationServiceTest AbstractRecycleTestCase SplitStorageTest AcronymVisibleFieldsTest SaltedPasswordServiceTest BulkUpdateTaskTest SaltedPasswordsUtilityTest TaskGroupVisibleFieldsTest AuthenticationServiceTest ActionVisibleFieldsTest NoteVisibleFieldsTest ActionHandlerTest WorkspaceServiceTest WorkspaceStageVisibleFieldsTest WorkspaceVisibleFieldsTest EscapeChildrenRenderingStandaloneTest EscapeChildrenRenderingTest

Protected Member Functions

 setUp ()
 
 getDatabaseConnection ()
 
 getConnectionPool ()
 
 importDataSet ($path)
 
 setUpFrontendRootPage ($pageId, array $typoScriptFiles=[])
 
 getFrontendResponse ($pageId, $languageId=0, $backendUserId=0, $workspaceId=0, $failOnFailure=true, $frontendUserId=0)
 
- Protected Member Functions inherited from BaseTestCase
 getAccessibleMock ($originalClassName, $methods=[], array $arguments=[], $mockClassName= '', $callOriginalConstructor=true, $callOriginalClone=true, $callAutoload=true)
 
 getAccessibleMockForAbstractClass ($originalClassName, array $arguments=[], $mockClassName= '', $callOriginalConstructor=true, $callOriginalClone=true, $callAutoload=true, $mockedMethods=[])
 
 buildAccessibleProxy ($className)
 
 callInaccessibleMethod ($object, $name,...$arguments)
 
 inject ($target, $name, $dependency)
 
 getUniqueId ($prefix= '')
 

Protected Attributes

 $identifier
 
 $instancePath
 
 $coreExtensionsToLoad = []
 
 $testExtensionsToLoad = []
 
 $pathsToLinkInTestInstance = []
 
 $configurationToUseInTestInstance = []
 
 $additionalFoldersToCreate = []
 
 $backendUserFixture = 'typo3/sysext/core/Tests/Functional/Fixtures/be_users.xml'
 
- Protected Attributes inherited from BaseTestCase
 $backupGlobals = true
 
 $backupStaticAttributes = false
 

Detailed Description

Base test case class for functional tests, all TYPO3 CMS functional tests should extend from this class!

If functional tests need additional setUp() and tearDown() code, they must call parent::setUp() and parent::tearDown() to properly set up and destroy the test system.

The functional test system creates a full new TYPO3 CMS instance within typo3temp/ of the base system and the bootstraps this TYPO3 instance. This abstract class takes care of creating this instance with its folder structure and a LocalConfiguration, creates an own database for each test run and imports tables of loaded extensions.

Functional tests must be run standalone (calling native phpunit directly) and can not be executed by eg. the ext:phpunit backend module. Additionally, the script must be called from the document root of the instance, otherwise path calculation is not successfully.

Call whole functional test suite, example:

  • cd /var/www/t3master/foo # Document root of CMS instance, here is index.php of frontend
  • typo3/../bin/phpunit -c typo3/sysext/core/Build/FunctionalTests.xml

Call single test case, example:

Definition at line 54 of file FunctionalTestCase.php.

Member Function Documentation

getDatabaseConnection ( )
protected

Get DatabaseConnection instance - $GLOBALS['TYPO3_DB']

This method should be used instead of direct access to $GLOBALS['TYPO3_DB'] for easy IDE auto completion.

Returns
Deprecated:
since TYPO3 v8, will be removed in TYPO3 v9

Definition at line 267 of file FunctionalTestCase.php.

References $GLOBALS, and GeneralUtility\logDeprecatedFunction().

getFrontendResponse (   $pageId,
  $languageId = 0,
  $backendUserId = 0,
  $workspaceId = 0,
  $failOnFailure = true,
  $frontendUserId = 0 
)
protected
Parameters
int$pageId
int$languageId
int$backendUserId
int$workspaceId
bool$failOnFailure
int$frontendUserId
Returns
Response

Definition at line 384 of file FunctionalTestCase.php.

References FunctionalTestCase\$instancePath, and Response\STATUS_Failure.

Referenced by ActionTest\addCategoryRelation(), ActionTest\addElementRelation(), ActionTest\changeCategoryRelationSorting(), ActionTest\changeContentSorting(), ActionTest\changeContentSortingAndCopyDraftPage(), ActionTest\changeContentSortingAndCopyLivePage(), ActionTest\changeContentSortingAndDeleteLiveRecord(), ActionTest\changeContentSortingAndDeleteMovedRecord(), ActionTest\changeElementRelationSorting(), ActionTest\changeElementSorting(), ActionTest\changePageSorting(), ActionTest\changeParentContentSorting(), ActionTest\copyCategoryOfRelation(), ActionTest\copyContent(), ActionTest\copyContentOfRelation(), ActionTest\copyElementOfRelation(), ActionTest\copyPage(), ActionTest\copyPageWithHotelBeforeParentContent(), ActionTest\copyParentContent(), ActionTest\copyParentContentToDifferentPage(), ActionTest\copyPasteContent(), ActionTest\createAndCopyContentAndDiscardCopiedContent(), ActionTest\createAndCopyParentContentWithHotelAndOfferChildren(), ActionTest\createAndCopyParentContentWithHotelAndOfferChildrenAndDiscardCopiedParent(), ActionTest\createAndLocalizeParentContentWithHotelAndOfferChildren(), ActionTest\createAndLocalizeParentContentWithHotelAndOfferChildrenAndDiscardCreatedParent(), ActionTest\createAndLocalizeParentContentWithHotelAndOfferChildrenAndDiscardLocalizedParent(), ActionTest\createAndLocalizeParentContentWithHotelAndOfferChildrenWithoutSortByConfiguration(), ActionTest\createCategoryAndAddRelation(), ActionTest\createContentAndAddElementRelation(), ActionTest\createContentAndAddRelation(), ActionTest\createContentAndCopyDraftPage(), ActionTest\createContentAndCopyLivePage(), ActionTest\createContentAndCreateElementRelation(), ActionTest\createContentAndCreateRelation(), ActionTest\createContentAndDiscardCreatedContent(), ActionTest\createContents(), ActionTest\createContentWithFileReference(), ActionTest\createNestedPagesAndCopyDraftParentPage(), ActionTest\createNestedPagesAndCopyLiveParentPage(), ActionTest\createPage(), ActionTest\createPageAndCopyDraftParentPage(), ActionTest\createPageAndCopyLiveParentPage(), ActionTest\createParentContent(), ActionTest\createParentContentWithHotelAndOfferChildren(), ActionTest\deleteCategoryOfRelation(), ActionTest\deleteCategoryRelation(), ActionTest\deleteContent(), ActionTest\deleteContentAndCopyDraftPage(), ActionTest\deleteContentAndCopyLivePage(), ActionTest\deleteContentAndPage(), ActionTest\deleteContentOfRelation(), ActionTest\deleteElementOfRelation(), ActionTest\deleteElementRelation(), ActionTest\deleteLocalizedContentAndDeleteContent(), ActionTest\deletePage(), ActionTest\deleteParentContent(), ActionTest\deleteParentContentAndDiscardDeletedParent(), ActionTest\localizeCategoryOfRelation(), ActionTest\localizeContent(), ActionTest\localizeContentFromNonDefaultLanguage(), ActionTest\localizeContentOfRelation(), ActionTest\localizeElementOfRelation(), ActionTest\localizePage(), ActionTest\localizeParentContentInKeepMode(), ActionTest\localizeParentContentInSelectMode(), ActionTest\localizeParentContentWithAllChildrenInKeepMode(), ActionTest\localizeParentContentWithAllChildrenInSelectMode(), ActionTest\modifyAndDiscardAndModifyParentWithHotelChild(), ActionTest\modifyBothSidesOfRelation(), ActionTest\modifyBothsOfRelation(), ActionTest\modifyCategoryOfRelation(), ActionTest\modifyContent(), ActionTest\modifyContentAndAddFileReference(), ActionTest\modifyContentAndDeleteAllFileReference(), ActionTest\modifyContentAndDeleteFileReference(), ActionTest\modifyContentOfRelation(), ActionTest\modifyContentWithFileReference(), ActionTest\modifyElementOfRelation(), ActionTest\modifyOnlyHotelChild(), ActionTest\modifyPage(), ActionTest\modifyParentAndAddHotelChild(), ActionTest\modifyParentAndChangeHotelChildrenSorting(), ActionTest\modifyParentAndDeleteHotelChild(), ActionTest\modifyParentContent(), ActionTest\modifyParentWithHotelChild(), ActionTest\modifyParentWithHotelChildAndDiscardAll(), ActionTest\modifyParentWithHotelChildAndDiscardModifiedParent(), ActionTest\moveContentAndCopyDraftPage(), ActionTest\moveContentAndCopyLivePage(), ActionTest\moveContentOfRelationToDifferentPage(), ActionTest\moveContentToDifferentPage(), ActionTest\moveContentToDifferentPageAndChangeSorting(), ActionTest\movePageToDifferentPage(), ActionTest\movePageToDifferentPageAndChangeSorting(), ActionTest\movePageToDifferentPageAndCreatePageAfterMovedPage(), ActionTest\moveParentContentToDifferentPage(), ActionTest\moveParentContentToDifferentPageAndChangeSorting(), ActionTest\movePasteContentToDifferentPage(), EnableFieldsTest\onlyOwnProtectedRecordsWithQueryCacheInvolvedAreReturned(), EnableFieldsTest\onlyReturnProtectedRecordsForTheFirstUserGroup(), EnableFieldsTest\onlyReturnProtectedRecordsForTheSecondUserGroup(), and EnableFieldsTest\protectedRecordsNotFoundIfNoUserLoggedIn().

importDataSet (   $path)
protected

Imports a data set represented as XML into the test database,

Parameters
string$pathAbsolute path to the XML file containing the data set to load
Returns
void
Exceptions
Exception

Definition at line 330 of file FunctionalTestCase.php.

Referenced by ResourceStorageTest\createFolderThrowsExceptionIfParentFolderDoesNotExist(), ExportTest\exportPagesAndRelatedTtContentWithImages(), ExportTest\exportPagesAndRelatedTtContentWithImagesButNotIncluded(), ExportTest\exportPagesAndRelatedTtContentWithImagesFromCorruptSysFileRecord(), ResourceStorageTest\getNestedProcessingFolderTest(), ResourceStorageTest\getProcessingRootFolderTest(), ResourceStorageTest\getRoleReturnsDefaultForRegularFolders(), ImportInFilledDatabaseTest\importPagesAndRelatedTtContentWithDifferentImageToExistingData(), ImportInFilledDatabaseTest\importPagesAndRelatedTtContentWithSameImageToExistingData(), ResourceStorageTest\isWithinFileMountBoundariesRespectsReadOnlyFileMounts(), WorkspaceServiceTest\movedElementsCanBeFoundAtTheirDestination(), WorkspaceServiceTest\movedElementsCanBeFoundUsingTheirLiveUid(), WorkspaceServiceTest\movedElementsCanNotBeFoundAtTheirOrigin(), LocalizationControllerTest\recordsGetCopiedFromAnotherLanguage(), LocalizationControllerTest\recordsGetTranslatedFromDifferentTranslation(), ResourceStorageTest\replaceFileFailsIfLocalFileDoesNotExist(), ActionHandlerTest\sendToSpecificStageExecuteIgnoresDoublePublishes(), WorkspaceServiceTest\setUp(), AuthenticationServiceTest\setUp(), TypoScriptFrontendControllerTest\setUp(), AdminRecycleTest\setUp(), UserRecycleTest\setUp(), PageRepositoryTest\setUp(), LocalizationControllerTest\setUp(), EnableFieldsTest\setUp(), ExportTest\setUp(), SaltedPasswordsUtilityTest\setUp(), AbstractRecycleTestCase\setUp(), QueryParserTest\setUp(), RelationTest\setUp(), SaltedPasswordServiceTest\setUp(), TranslationTest\setUp(), InTest\setUp(), AbstractActionTestCase\setUp(), OperatorTest\setUp(), BulkUpdateTaskTest\setUp(), WorkspaceVisibleFieldsTest\setUp(), CountTest\setUp(), SplitStorageTest\setUp(), WorkspaceServiceTest\versionsCanBeFilteredToSpecificLifecycleStep(), WorkspaceServiceTest\versionsCanBeFilteredToSpecificStage(), WorkspaceServiceTest\versionsCanBeFoundRecursive(), WorkspaceServiceTest\versionsFromAllWorkspaceCanBeFound(), and WorkspaceServiceTest\versionsFromSpecificWorkspaceCanBeFound().

setUp ( )
protected

Set up creates a test instance and database.

This method should be called with parent::setUp() in your test cases!

Returns
void

Definition at line 191 of file FunctionalTestCase.php.

References FunctionalTestCase\$identifier.

setUpFrontendRootPage (   $pageId,
array  $typoScriptFiles = [] 
)
protected
Parameters
int$pageId
array$typoScriptFiles

Definition at line 340 of file FunctionalTestCase.php.

References GeneralUtility\makeInstance().

Referenced by EnableFieldsTest\setUp(), and AbstractActionTestCase\setUp().

Member Data Documentation

$additionalFoldersToCreate = []
protected

Definition at line 175 of file FunctionalTestCase.php.

$backendUserFixture = 'typo3/sysext/core/Tests/Functional/Fixtures/be_users.xml'
protected

Definition at line 182 of file FunctionalTestCase.php.

$configurationToUseInTestInstance = []
protected

Definition at line 149 of file FunctionalTestCase.php.

$coreExtensionsToLoad = []
protected

Definition at line 89 of file FunctionalTestCase.php.

$identifier
protected

Definition at line 62 of file FunctionalTestCase.php.

Referenced by FunctionalTestCase\setUp().

$instancePath
protected

Definition at line 70 of file FunctionalTestCase.php.

Referenced by FunctionalTestCase\getFrontendResponse().

$pathsToLinkInTestInstance = []
protected

Definition at line 141 of file FunctionalTestCase.php.

$testExtensionsToLoad = []
protected

Definition at line 111 of file FunctionalTestCase.php.