[TYPO3-extbase-kickstarter] Fixing failures of Unit tests for Domain Models

Raphael Weber mailinglisten at screensolutions.de
Fri Jul 6 13:50:19 CEST 2012


Hi,

when I´m running the basic unit tests for my domain models written by 
the Extension Builder I usally get error reports of failures concerning 
model properties having the value types integer, float or boolean.

For example:
"Failure in test case getEarnedReturnsInitialValueForFloat
File: 
typo3conf/ext/phpunit/PEAR/PHPUnit/Framework/Constraint/IsIdentical.php
Line: 132
Failed asserting that null is identical to 0.0."

What´s the correct way to eliminnate those errors? Is it ok to give the 
property an initial value when it´s declared in the Model, e.g:

	/**
	 * earned budget
	 *
	 * @var float
	 */
	protected $earned = 0.0;


Any hints for an extbase beginner like me ;)

	raphael


More information about the TYPO3-project-extbase-kickstarter mailing list