TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
DateTimeConverterTest Class Reference
Inheritance diagram for DateTimeConverterTest:
UnitTestCase BaseTestCase

Public Member Functions

 checkMetadata ()
 
 canConvertFromReturnsFalseIfTargetTypeIsNotDateTime ()
 
 canConvertFromReturnsTrueIfSourceTypeIsAString ()
 
 canConvertFromReturnsTrueIfSourceTypeIsAnEmptyString ()
 
 convertFromReturnsErrorIfGivenStringCantBeConverted ()
 
 convertFromProperlyConvertsStringWithDefaultDateFormat ()
 
 convertFromUsesDefaultDateFormatIfItIsNotConfigured ()
 
 convertFromEmptyStringReturnsNull ()
 
 convertFromStringDataProvider ()
 
 convertFromStringTests ($source, $dateFormat, $isValid)
 
 convertFromIntegerOrDigitStringsWithoutConfigurationDataProvider ()
 
 convertFromIntegerOrDigitStringWithoutConfigurationTests ($source)
 
 convertFromIntegerOrDigitStringInArrayWithoutConfigurationTests ($source)
 
 canConvertFromReturnsTrueIfSourceTypeIsAnArray ()
 
 convertFromReturnsErrorIfGivenArrayCantBeConverted ()
 
 convertFromThrowsExceptionIfGivenArrayDoesNotSpecifyTheDate ()
 
 convertFromProperlyConvertsArrayWithDefaultDateFormat ()
 
 invalidDatePartKeyValuesDataProvider ()
 
 convertFromThrowsExceptionIfDatePartKeysHaveInvalidValuesSpecified ($source)
 
 convertFromProperlyConvertsArrayWithDateAsArray ()
 
 convertFromAllowsToOverrideTheTime ()
 
 convertFromAllowsToOverrideTheTimezone ()
 
 convertFromThrowsExceptionIfSpecifiedTimezoneIsInvalid ()
 
 convertFromArrayThrowsExceptionForEmptyArray ()
 
 convertFromArrayReturnsNullForEmptyDate ()
 
 convertFromArrayDataProvider ()
 
 convertFromArrayTests (array $source, $isValid)
 
 convertFromSupportsDateTimeSubClasses ()
 

Protected Member Functions

 setUp ()
 
- 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

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

Detailed Description

Test case

Definition at line 30 of file DateTimeConverterTest.php.

Member Function Documentation

canConvertFromReturnsFalseIfTargetTypeIsNotDateTime ( )

String to DateTime testcases

Test:

Definition at line 57 of file DateTimeConverterTest.php.

canConvertFromReturnsTrueIfSourceTypeIsAnArray ( )
Test:

Definition at line 217 of file DateTimeConverterTest.php.

canConvertFromReturnsTrueIfSourceTypeIsAnEmptyString ( )
Test:

Definition at line 73 of file DateTimeConverterTest.php.

canConvertFromReturnsTrueIfSourceTypeIsAString ( )
Test:

Definition at line 65 of file DateTimeConverterTest.php.

checkMetadata ( )
Test:

Definition at line 45 of file DateTimeConverterTest.php.

convertFromAllowsToOverrideTheTime ( )
Test:

Definition at line 300 of file DateTimeConverterTest.php.

convertFromAllowsToOverrideTheTimezone ( )
Test:

Definition at line 319 of file DateTimeConverterTest.php.

convertFromArrayDataProvider ( )
Returns
array
See also
convertFromArrayTests()

Definition at line 371 of file DateTimeConverterTest.php.

convertFromArrayReturnsNullForEmptyDate ( )
Test:

Definition at line 362 of file DateTimeConverterTest.php.

convertFromArrayTests ( array  $source,
  $isValid 
)
Parameters
array$sourcethe array to be converted
bool$isValidTRUE if the conversion is expected to be successful, otherwise FALSE
Test:
convertFromArrayDataProvider

Definition at line 393 of file DateTimeConverterTest.php.

References DateTimeConverter\DEFAULT_DATE_FORMAT.

convertFromArrayThrowsExceptionForEmptyArray ( )
Test:

Definition at line 352 of file DateTimeConverterTest.php.

convertFromEmptyStringReturnsNull ( )
Test:

Definition at line 119 of file DateTimeConverterTest.php.

convertFromIntegerOrDigitStringInArrayWithoutConfigurationTests (   $source)

Array to DateTime testcases

Test:
Parameters
$sourceconvertFromIntegerOrDigitStringsWithoutConfigurationDataProvider

Definition at line 207 of file DateTimeConverterTest.php.

convertFromIntegerOrDigitStringsWithoutConfigurationDataProvider ( )
convertFromIntegerOrDigitStringWithoutConfigurationTests (   $source)
Test:
Parameters
$sourceconvertFromIntegerOrDigitStringsWithoutConfigurationDataProvider

Definition at line 193 of file DateTimeConverterTest.php.

convertFromProperlyConvertsArrayWithDateAsArray ( )
Test:

Definition at line 282 of file DateTimeConverterTest.php.

convertFromProperlyConvertsArrayWithDefaultDateFormat ( )
Test:

Definition at line 244 of file DateTimeConverterTest.php.

convertFromProperlyConvertsStringWithDefaultDateFormat ( )
Test:

Definition at line 90 of file DateTimeConverterTest.php.

convertFromReturnsErrorIfGivenArrayCantBeConverted ( )
Test:

Definition at line 225 of file DateTimeConverterTest.php.

convertFromReturnsErrorIfGivenStringCantBeConverted ( )
Test:

Definition at line 81 of file DateTimeConverterTest.php.

convertFromStringDataProvider ( )
Returns
array
See also
convertFromStringTests()

Definition at line 129 of file DateTimeConverterTest.php.

convertFromStringTests (   $source,
  $dateFormat,
  $isValid 
)
Parameters
string$sourcethe string to be converted
string$dateFormatthe expected date format
bool$isValidTRUE if the conversion is expected to be successful, otherwise FALSE
Test:
convertFromStringDataProvider

Definition at line 150 of file DateTimeConverterTest.php.

References DateTimeConverter\DEFAULT_DATE_FORMAT.

convertFromSupportsDateTimeSubClasses ( )
Test:

Definition at line 424 of file DateTimeConverterTest.php.

convertFromThrowsExceptionIfDatePartKeysHaveInvalidValuesSpecified (   $source)
Test:
invalidDatePartKeyValuesDataProvider

Definition at line 272 of file DateTimeConverterTest.php.

convertFromThrowsExceptionIfGivenArrayDoesNotSpecifyTheDate ( )
Test:

Definition at line 234 of file DateTimeConverterTest.php.

convertFromThrowsExceptionIfSpecifiedTimezoneIsInvalid ( )
Test:

Definition at line 337 of file DateTimeConverterTest.php.

convertFromUsesDefaultDateFormatIfItIsNotConfigured ( )
Test:

Definition at line 101 of file DateTimeConverterTest.php.

invalidDatePartKeyValuesDataProvider ( )
setUp ( )
protected

Definition at line 37 of file DateTimeConverterTest.php.

Member Data Documentation

$converter
protected

Definition at line 35 of file DateTimeConverterTest.php.