PHP Class Craft\ImportServiceTest

Author: Bob Olde Hampsink ([email protected])
Inheritance: extends craft\BaseTest
Afficher le fichier Open project: boboldehampsink/import

Méthodes publiques

Méthode Description
provideValidFieldTypeData ( ) : array
setUp ( ) Setup mock localization service.
setUpBeforeClass ( )
testColumnsShouldReturnColumnRow ( )
testDataShouldReturnDataRows ( )
testFinishShouldMailResults ( )
testGetCustomOptionShouldReturnFalseWhenNoCustomOptionFound ( )
testGetCustomOptionShouldReturnOptionWhenFound ( )
testPrepForFieldType ( string $fieldType, string $data, array $settingsMap, string $criteria, string $expectedResult ) Test preparing value for field type.
testRowShouldCallCallbackWhenSaveSucceeds ( )
testRowShouldCatchExceptions ( )
testRowShouldLogErrorWhenColumnsAndDataDoNotMatch ( )
testRowShouldLogErrorWhenSaveFails ( )
testRowShouldThrowExceptionWhenTypeUnknown ( )
testRowUniqueReplaceOrDeleteShouldDeleteExistingElement ( )
testRowUniqueReplaceOrDeleteShouldDoNothingWhenNoResultFound ( )
testRowUniqueReplaceOrDeleteShouldFindExistingElement ( )
testRowUniqueReplaceOrDeleteShouldLogErrorWhenDeleteFails ( )
testRowUniqueReplaceOrDeleteShouldLogErrorWhenFieldValueEmpty ( )
testRowUniqueReplaceOrDeleteShouldThrowExceptionWhenPermissionDenied ( )
testSlugifyShouldSlugifyString ( )

Méthodes protégées

Méthode Description
getMockAssetFileModel ( string $file ) : craft\AssetFileModel Get mock asset file model.
getMockAssetSourceModel ( string $file ) : craft\AssetSourceModel Get mock asset source model.
getMockTag ( ) : PHPUnit_Framework_MockObject_MockObject
setMockAssetsService ( string $file ) Set mock assets service.
setMockCategoriesService ( ) Set mock categories service getGroupLocales.
setMockElementsServiceForFieldType ( array $criteria )
setMockTagsService ( PHPUnit_Framework_MockObject_MockObject $mockTag )

Private Methods

Méthode Description
getMockCriteria ( ) : PHPUnit_Framework_MockObject_MockObject | craft\ElementCriteriaModel
getMockEntry ( ) : PHPUnit_Framework_MockObject_MockObject | craft\ElementCriteriaModel
getMockLocalAssetSourceType ( string $file ) : craft\AssetSourceModel Mock LocalAssetSourceType.
getMockUser ( ) : PHPUnit_Framework_MockObject_MockObject
setMockFieldsService ( string $fieldHandle, PHPUnit_Framework_MockObject_MockObject $mockField )
setMockImportEntryService ( array $settings, PHPUnit_Framework_MockObject_MockObject $mockEntry, array $fields, boolean $saveSuccess = null ) : PHPUnit_Framework_MockObject_MockObject | craft\Import_EntryService
setMockImportHistoryService ( integer $historyId, integer $row, string $message )
setMockLocalizationService ( ) Mock LocalizationService.
setMockSettings ( array $settingsMap, PHPUnit_Framework_MockObject_MockObject $mockField )
setMockUserSession ( PHPUnit_Framework_MockObject_MockObject $mockUser )
setMockUsersService ( PHPUnit_Framework_MockObject_MockObject $mockUser )

Method Details

getMockAssetFileModel() protected méthode

Get mock asset file model.
protected getMockAssetFileModel ( string $file ) : craft\AssetFileModel
$file string
Résultat craft\AssetFileModel

getMockAssetSourceModel() protected méthode

Get mock asset source model.
protected getMockAssetSourceModel ( string $file ) : craft\AssetSourceModel
$file string
Résultat craft\AssetSourceModel

getMockTag() protected méthode

protected getMockTag ( ) : PHPUnit_Framework_MockObject_MockObject
Résultat PHPUnit_Framework_MockObject_MockObject

provideValidFieldTypeData() public méthode

public provideValidFieldTypeData ( ) : array
Résultat array

setMockAssetsService() protected méthode

Set mock assets service.
protected setMockAssetsService ( string $file )
$file string

setMockCategoriesService() protected méthode

Set mock categories service getGroupLocales.
protected setMockCategoriesService ( )

setMockElementsServiceForFieldType() protected méthode

protected setMockElementsServiceForFieldType ( array $criteria )
$criteria array

setMockTagsService() protected méthode

protected setMockTagsService ( PHPUnit_Framework_MockObject_MockObject $mockTag )
$mockTag PHPUnit_Framework_MockObject_MockObject

setUp() public méthode

Setup mock localization service.
public setUp ( )

setUpBeforeClass() public static méthode

public static setUpBeforeClass ( )

testColumnsShouldReturnColumnRow() public méthode

testDataShouldReturnDataRows() public méthode

testFinishShouldMailResults() public méthode

testGetCustomOptionShouldReturnFalseWhenNoCustomOptionFound() public méthode

testGetCustomOptionShouldReturnOptionWhenFound() public méthode

testPrepForFieldType() public méthode

Test preparing value for field type.
public testPrepForFieldType ( string $fieldType, string $data, array $settingsMap, string $criteria, string $expectedResult )
$fieldType string
$data string
$settingsMap array
$criteria string
$expectedResult string

testRowShouldCallCallbackWhenSaveSucceeds() public méthode

testRowShouldCatchExceptions() public méthode

testRowShouldLogErrorWhenColumnsAndDataDoNotMatch() public méthode

testRowShouldLogErrorWhenSaveFails() public méthode

testRowShouldThrowExceptionWhenTypeUnknown() public méthode

testRowUniqueReplaceOrDeleteShouldDeleteExistingElement() public méthode

testRowUniqueReplaceOrDeleteShouldDoNothingWhenNoResultFound() public méthode

testRowUniqueReplaceOrDeleteShouldFindExistingElement() public méthode

testRowUniqueReplaceOrDeleteShouldLogErrorWhenDeleteFails() public méthode

testRowUniqueReplaceOrDeleteShouldLogErrorWhenFieldValueEmpty() public méthode

testRowUniqueReplaceOrDeleteShouldThrowExceptionWhenPermissionDenied() public méthode

testSlugifyShouldSlugifyString() public méthode