35 $this->converter = new \TYPO3\CMS\Extbase\Property\TypeConverter\FloatConverter();
42 $this->assertEquals(array(
'float',
'integer',
'string'), $this->converter->getSupportedSourceTypes(),
'Source types do not match');
43 $this->assertEquals(
'float', $this->converter->getSupportedTargetType(),
'Target type does not match');
44 $this->assertEquals(1, $this->converter->getPriority(),
'Priority does not match');
51 $this->assertSame(1.5, $this->converter->convertFrom(
'1.5',
'float'));
58 $this->assertNull($this->converter->convertFrom(
'',
'float'));
65 $this->assertSame((
float)123, $this->converter->convertFrom(123,
'float'));
72 $this->assertInstanceOf(
'TYPO3\CMS\Extbase\Error\Error', $this->converter->convertFrom(
'not numeric',
'float'));
79 $this->assertTrue($this->converter->canConvertFrom(
'1.5',
'float'));
86 $this->assertTrue($this->converter->canConvertFrom(
'',
'integer'));
93 $this->assertTrue($this->converter->canConvertFrom(NULL,
'integer'));
100 $this->assertEquals(array(), $this->converter->getSourceChildPropertiesToBeConverted(
'myString'));
canConvertFromShouldReturnTrue()
convertFromShouldAcceptIntegers()
convertFromReturnsAnErrorIfSpecifiedStringIsNotNumeric()
convertFromReturnsNullIfEmptyStringSpecified()
canConvertFromShouldReturnTrueForANullValue()
canConvertFromShouldReturnTrueForAnEmptyValue()
convertFromShouldCastTheStringToFloat()
getSourceChildPropertiesToBeConvertedShouldReturnEmptyArray()