[TYPO3-english] phpUnit and old-school extensions

Stefan Frömken firma at sfroemken.de
Sat Jul 30 15:35:10 CEST 2011


Hello list,

I'm just learning to use phpUnit to programm more stable extension and I 
have programmed my first little Array-Test without any problems. But now 
I will go one step further and I will test if my Objekt tx_sfimmo_pi1 
has a special property set. There is a phpUnit-function which makes this 
possible:

require_once(t3lib_extMgm::extPath('sfimmo') . 
'pi1/class.tx_sfimmo_pi1.php');

/**
  * @test
  */
public function init() {
	$this->obj = new tx_sfimmo_pi1;
	$this->assertObjectHasAttribute('subpartArray', $obj, 'Attribute not 
found in this Object');
	//$this->assertClassHasAttribute('subpartArray', 'tx_sfimmo_pi1', 
'Attribute not found in this Class');
}

There is no problem with my commented line (classHasAttribute). I think 
there is a problem with creating an instance of my Class tx_sfimmo_pi1.

Maybe you have an idea how to create an instance of my plugin here in my 
test class.

PHPUnit shows a fail but without any more informations for debugging.

Stefan


More information about the TYPO3-english mailing list