[TYPO3-english] phpUnit and old-school extensions

Søren Malling soren.malling at gmail.com
Sat Jul 30 15:44:20 CEST 2011


Hi

I don't know that much about phpunit, but it seems that you object variable
is wrong.

Use $this->obj instead of $obj

Regards

Søren

On Saturday, July 30, 2011, Stefan Frömken <firma at sfroemken.de> wrote:
> 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
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english
>

-- 

Søren Malling

TYPO3 Translation Admin - http://translation.TYPO3.org
TYPO3 Usergroup Denmark - www.typo3danmark.dk
Twitter: twitter.com/sorenmalling


More information about the TYPO3-english mailing list