TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
BaseTestCase Class Reference
Inheritance diagram for BaseTestCase:
UnitTestCase BaseTestCase FileCollectionRegistryTest AbstractDriverTest AbstractHierarchicalFilesystemDriverTest LocalDriverTest ResourceCompressorTest ResourceStorageTest ContentTypesToTextMediaUpdateTest

Protected Member Functions

 setUp ()
 
 getMountRootUrl ()
 
 mergeToVfsContents ($contents)
 
 initializeVfs ()
 
 addToMount (array $dirStructure)
 
 getUrlInMount ($path)
 
 addToVfs (array $dirStructure)
 
 getUrl ($path)
 
 _createFileFolderMock ($type, $identifier, $mockedMethods)
 
 getSimpleFileMock ($identifier, $mockedMethods=[])
 
 getSimpleFolderMock ($identifier, $mockedMethods=[])
 
 getFolderMock ($identifier, $mockedMethods=[], $subfolders=[], $files=[])
 
- Protected Member Functions inherited from UnitTestCase
 tearDown ()
 
- 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

 $basedir = 'basedir'
 
 $mountDir
 
 $vfsContents = []
 
- Protected Attributes inherited from UnitTestCase
 $backupGlobalsBlacklist = ['TYPO3_LOADED_EXT']
 
 $testFilesToDelete = []
 
- Protected Attributes inherited from BaseTestCase
 $backupGlobals = true
 
 $backupStaticAttributes = false
 

Detailed Description

Basic test case for the tests

Definition at line 22 of file Tests/Unit/Resource/BaseTestCase.php.

Member Function Documentation

_createFileFolderMock (   $type,
  $identifier,
  $mockedMethods 
)
protected

Creates a file or folder mock. This should not be called directly, but only through getSimple{File,Folder}Mock()

Parameters
$type
$identifier
$mockedMethods
Returns
|

Definition at line 112 of file Tests/Unit/Resource/BaseTestCase.php.

Referenced by BaseTestCase\getFolderMock(), BaseTestCase\getSimpleFileMock(), and BaseTestCase\getSimpleFolderMock().

addToMount ( array  $dirStructure)
protected

Adds the given directory structure to the mount folder in the VFS. Existing files will be overwritten!

Parameters
array$dirStructure
Returns
void

Definition at line 66 of file Tests/Unit/Resource/BaseTestCase.php.

References BaseTestCase\mergeToVfsContents().

Referenced by LocalDriverTest\addFileFailsIfFileIsInDriverStorage(), LocalDriverTest\addFileMovesFileToCorrectLocation(), LocalDriverTest\addFileReturnsFileIdentifier(), LocalDriverTest\addFileUsesFilenameIfGiven(), LocalDriverTest\copyFolderWithinStorageCopiesSingleFileToNewFolderName(), ResourceStorageTest\createFolderCanRecursivelyCreateFolders(), LocalDriverTest\createFolderCreatesFolderOnDisk(), ResourceStorageTest\createFolderCreatesNestedStructureEvenIfPartsAlreadyExist(), LocalDriverTest\createFolderReturnsFolderObject(), LocalDriverTest\createFolderSanitizesFolderNameBeforeCreation(), LocalDriverTest\existenceChecksInFolderWorkForFilesAndFolders(), LocalDriverTest\existenceChecksWorkForFilesAndFolders(), LocalDriverTest\fileContentsCanBeWrittenAndRead(), LocalDriverTest\fileMetadataIsChangedAfterMovingFile(), LocalDriverTest\filesCanBeCopiedToATemporaryPath(), LocalDriverTest\filesCanBeCopiedWithinStorage(), LocalDriverTest\filesCanBeMovedWithinStorage(), LocalDriverTest\folderCanBeRenamedWhenMoving(), LocalDriverTest\getAbsolutePathReturnsCorrectPath(), LocalDriverTest\getFileForLocalProcessingCreatesCopyOfFileByDefault(), LocalDriverTest\getFileForLocalProcessingReturnsOriginalFilepathForReadonlyAccess(), LocalDriverTest\getFileInFolderCallsConfiguredCallbackFunctionWithGivenItemName(), LocalDriverTest\getFileListFailsIfDirectoryDoesNotExist(), LocalDriverTest\getFileListFiltersItemsWithGivenFilterMethods(), LocalDriverTest\getFileListReturnsAllFilesInDirectory(), LocalDriverTest\getFileListReturnsAllFilesInSubdirectoryIfRecursiveParameterIsSet(), LocalDriverTest\getFolderInFolderReturnsCorrectFolderObject(), LocalDriverTest\getFolderListFiltersItemsWithGivenFilterMethods(), LocalDriverTest\getFolderListLeavesOutNavigationalEntries(), LocalDriverTest\getFolderListReturnsAllDirectoriesInDirectory(), LocalDriverTest\getFolderListReturnsHiddenFoldersByDefault(), LocalDriverTest\getPublicUrlReturnsCorrectUriForConfiguredBaseUri(), LocalDriverTest\hashReturnsCorrectHashes(), LocalDriverTest\isFolderEmptyReturnsFalseIfFolderHasFile(), LocalDriverTest\isFolderEmptyReturnsFalseIfFolderHasSubfolder(), LocalDriverTest\isFolderEmptyReturnsTrueForEmptyFolder(), LocalDriverTest\moveFolderWithinStorageReturnsCorrectMappingInformationForAllFiles(), LocalDriverTest\renameFolderReturnsCorrectMappingInformationForAllFiles(), LocalDriverTest\renameFolderRevertsRenamingIfFilenameMapCannotBeCreated(), LocalDriverTest\renamingFilesChangesFilenameOnDisk(), LocalDriverTest\renamingFilesFailsIfTargetFileExists(), LocalDriverTest\renamingFoldersChangesFolderNameOnDisk(), LocalDriverTest\setFileContentsReturnsNumberOfBytesWrittenToFile(), and ResourceStorageTest\storageUsesInjectedFilemountsToCheckForMountBoundaries().

addToVfs ( array  $dirStructure)
protected

Adds the given directory structure to the VFS. Existing files will be overwritten!

Parameters
array$dirStructure
Returns
void

Definition at line 88 of file Tests/Unit/Resource/BaseTestCase.php.

References BaseTestCase\mergeToVfsContents().

Referenced by LocalDriverTest\addFileMovesFileToCorrectLocation(), LocalDriverTest\addFileReturnsFileIdentifier(), and LocalDriverTest\addFileUsesFilenameIfGiven().

getFolderMock (   $identifier,
  $mockedMethods = [],
  $subfolders = [],
  $files = [] 
)
protected

Returns a mock of a folder object with subfolders and files.

Parameters
$identifier
array$mockedMethodsMethods to mock, in addition to getFiles and getSubfolders
TYPO3[] $subfolders
TYPO3[] $files
Returns
|

Definition at line 164 of file Tests/Unit/Resource/BaseTestCase.php.

References BaseTestCase\_createFileFolderMock().

getSimpleFileMock (   $identifier,
  $mockedMethods = [] 
)
protected

Returns a simple mock of a file object that just knows its identifier

Parameters
string$identifier
array$mockedMethodsthe methods to mock
Returns
|

Definition at line 138 of file Tests/Unit/Resource/BaseTestCase.php.

References BaseTestCase\_createFileFolderMock().

Referenced by ResourceStorageTest\storageUsesInjectedFilemountsToCheckForMountBoundaries().

getSimpleFolderMock (   $identifier,
  $mockedMethods = [] 
)
protected

Returns a simple mock of a file object that just knows its identifier

Parameters
string$identifier
array$mockedMethodsthe methods to mock
Returns

Definition at line 150 of file Tests/Unit/Resource/BaseTestCase.php.

References BaseTestCase\_createFileFolderMock().

Referenced by ResourceStorageTest\createFolderCallsDriverForFolderCreation(), ResourceStorageTest\createFolderChecksIfParentFolderExistsBeforeCreatingFolder(), and ResourceStorageTest\createFolderThrowsExceptionIfParentFolderDoesNotExist().

getUrl (   $path)
protected

Returns the URL for a path inside the VFS

Parameters
$path
Returns
string

Definition at line 99 of file Tests/Unit/Resource/BaseTestCase.php.

Referenced by LocalDriverTest\addFileMovesFileToCorrectLocation(), LocalDriverTest\addFileReturnsFileIdentifier(), and LocalDriverTest\addFileUsesFilenameIfGiven().

mergeToVfsContents (   $contents)
protected
setUp ( )
protected

Definition at line 33 of file Tests/Unit/Resource/BaseTestCase.php.

References BaseTestCase\getUniqueId().

Member Data Documentation

$basedir = 'basedir'
protected
$mountDir
protected

Definition at line 29 of file Tests/Unit/Resource/BaseTestCase.php.

$vfsContents = []
protected

Definition at line 31 of file Tests/Unit/Resource/BaseTestCase.php.