This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

Symfony2 phpUnit in Eclipse

Installation and environment issues, mainly on 1.x but there's some 2.x here too.

Symfony2 phpUnit in Eclipse

by pablorsmobail » Tue Aug 16, 2011 5:07 pm

Hello,
I try to install any visual unit test plugin into eclipse but i fail. I've tried with PTI (php tools integration) and with makeGood plugin but when i run the test... not work. Is possible that this may happen because phpunit in console need -c flag with app.
Someone has set eclipse with visual unit tests (green and red squares)????
Is a very good idea to explain this kind of things for do more powerful symfony2.
Thank you!
pablorsmobail
Junior Member
 
Posts: 2
Joined: Tue Aug 16, 2011 5:01 pm

Re: Symfony2 phpUnit in Eclipse

by iteman » Wed Aug 17, 2011 6:05 am

Symfony uses the KERNEL_DIR environment variable for finding *Kernel.php. If the variable is not found, Symfony uses the directory where the specified PHPUnit XML file exists from the command line arguments since no other way to find the directory. For more information, see the following URI:

https://github.com/symfony/symfony/blob ... e.php#L116

At this time you can explicitly specify the KERNEL_DIR in your PHPUnit XML file, but this way is not recommended bacause this works only in your environment.

For MakeGood, you can specify the following script as the preload script for this purpose.

the preload script:

Code: Select all
<?php
$_SERVER['KERNEL_DIR'] =  __DIR__;
iteman
Junior Member
 
Posts: 1
Joined: Wed Aug 17, 2011 5:31 am

Re: Symfony2 phpUnit in Eclipse

by pablorsmobail » Wed Aug 17, 2011 5:03 pm

Thank you for your reply but sorry im newbie in symfony2 and i need more especific steps.
pablorsmobail
Junior Member
 
Posts: 2
Joined: Tue Aug 16, 2011 5:01 pm

Re: Symfony2 phpUnit in Eclipse

by magabriel » Thu Aug 23, 2012 4:05 pm

I managed to get MakeGood working and wrote about it. Maybe you find it useful: http://dev4theweb.blogspot.com.es/2012/07/makegood-and-symfony2.html
magabriel
Junior Member
 
Posts: 1
Joined: Thu Aug 23, 2012 4:01 pm