35 $this->converter = new \TYPO3\CMS\Extbase\Property\TypeConverter\IntegerConverter();
42 $this->assertEquals(array(
'integer',
'string'), $this->converter->getSupportedSourceTypes(),
'Source types do not match');
43 $this->assertEquals(
'integer', $this->converter->getSupportedTargetType(),
'Target type does not match');
44 $this->assertEquals(1, $this->converter->getPriority(),
'Priority does not match');
51 $this->assertSame(15, $this->converter->convertFrom(
'15',
'integer'));
59 $this->assertSame($source, $this->converter->convertFrom($source,
'integer'));
66 $this->assertNull($this->converter->convertFrom(
'',
'integer'));
73 $this->assertInstanceOf(
'TYPO3\CMS\Extbase\Error\Error', $this->converter->convertFrom(
'not numeric',
'integer'));
80 $this->assertTrue($this->converter->canConvertFrom(
'15',
'integer'));
87 $this->assertTrue($this->converter->canConvertFrom(123,
'integer'));
94 $this->assertTrue($this->converter->canConvertFrom(
'',
'integer'));
101 $this->assertTrue($this->converter->canConvertFrom(NULL,
'integer'));
108 $this->assertEquals(array(), $this->converter->getSourceChildPropertiesToBeConverted(
'myString'));
convertFromReturnsNullIfEmptyStringSpecified()
canConvertFromShouldReturnTrueForANumericStringSource()
canConvertFromShouldReturnTrueForANullValue()
convertFromShouldCastTheStringToInteger()
getSourceChildPropertiesToBeConvertedShouldReturnEmptyArray()
canConvertFromShouldReturnTrueForAnEmptyValue()
convertFromReturnsAnErrorIfSpecifiedStringIsNotNumeric()
convertFromDoesNotModifyIntegers()
canConvertFromShouldReturnTrueForAnIntegerSource()