given the code:
// find the --configuration flag from PHPUnit
$cli = implode(' ', $_SERVER['argv']);
print_r($_SERVER['argv']);
if (preg_match('/\-\-configuration[= ]+([^ ]+)/', $cli, $matches)) {
$dir = $dir.'/'.$matches[1];
print $dir. "\n";
die(print_r($matches, true));
} elseif (preg_match('/\-c +([^ ]+)/', $cli, $matches)) {
$dir = $dir.'/'.$matches[1];
} else {
throw new \RuntimeException('Unable to guess the Kernel
directory.');
}
see what this snippet returns using test from NetBeans:
Array
(
[0] => C:\wamp\bin\php\php5.3.0\phpunit
[1] => --log-junit
[2] => C:\Users\Raphael\AppData\Local\Temp\nb-phpunit-log.xml
[3] => --bootstrap
[4] => D:\htdocs\symfony_2_sandbox\src\autoload.php
[5] => --configuration
[6] => D:\htdocs\symfony_2_sandbox\src\Application\Tests\phpunit.xml
[7] => NetBeansSuite
[8] => C:\Program Files\NetBeans 6.9.1\php\phpunit\NetBeansSuite.php
[9] =>
run=D:\htdocs\symfony_2_sandbox\src\Application\Tests\HelloBundle\Controller\HelloControllerTest.php
)
D:\htdocs\symfony_2_sandbox\src\Application\Tests/D:\htdocs\symfony_2_sandbox\src\Application\Tests\phpunit.xml
Array
(
[0] => --configuration
D:\htdocs\symfony_2_sandbox\src\Application\Tests\phpunit.xml
[1] => D:\htdocs\symfony_2_sandbox\src\Application\Tests\phpunit.xml
)
see that before "$dir = $dir.'/'.$matches[1];", $dir equal
"D:\htdocs\symfony_2_sandbox\src\Application\Tests", to:
$dir = $dir.'/'.$matches[1];
//
return
D:\htdocs\symfony_2_sandbox\src\Application\Tests/D:\htdocs\symfony_2_sandbox\src\Application\Tests\phpunit.xml
sorry, I'm lost and do not know if I'm helping or hindering.
On Tue, Oct 5, 2010 at 4:27 PM, Pablo Godel <[email protected]> wrote:
> Speaking of which?
>
> Anyone has a configuration sample for Netbeans so tests can be ran from the
> IDE?
>
> I have tried different options and I am getting errors and tests are not
> ran. Any pointers?
>
> Pablo
>
> ps: tests ran from command line with phpunit -c app/ work fine.
>
> On Tue, Oct 5, 2010 at 2:25 PM, Raphael <[email protected]> wrote:
>
>> speaking in Netbeans and other IDE's. I noticed that the tests are located
>> in its respective app / module, this would be a good practice?
>>
>> I do not know a lot of tests in the IDE's but I noticed in my research
>> that there is normally a single directory for all tests. Let the tests
>> Symfony2 distributed in various directories of the applications would not be
>> a bit confusing for those IDE's?
>>
>> Would not it be better a single cache directory?
>>
>> Applied to the directory or RC3 version of Symfony2 is only one example
>> that has no intention of it being applied?
>>
>> PS: sorry my bad English.
>>
>> On Tue, Oct 5, 2010 at 2:37 PM, raphox <[email protected]> wrote:
>>
>>> this problem is here:
>>>
>>> \symfony\src\Symfony\Bundle\FrameworkBundle\Test\WebTestCase.php line
>>> 49:
>>>
>>> // find the --configuration flag from PHPUnit
>>> $cli = implode(' ', $_SERVER['argv']);
>>> if (preg_match('/\-\-configuration[= ]+([^ ]+)/', $cli,
>>> $matches)) {
>>> $dir = $dir.'/'.$matches[1];
>>> } elseif (preg_match('/\-c +([^ ]+)/', $cli, $matches)) {
>>> $dir = $dir.'/'.$matches[1];
>>> } else {
>>> throw new \RuntimeException('Unable to guess the Kernel
>>> directory.');
>>> }
>>>
>>> this function captures the arguments passed by the command, and the
>>> conditional checks the arguments. but in some cases no argument is
>>> provided, thereby triggering the exception.
>>> I'm still studying this case.
>>>
>>> PS:
>>> - I'm trying to run the tests via NetBeans.
>>> - the coment "black magic below, you have been warned!" is great.
>>>
>>> On Sep 23, 8:47 pm, gordonslondon <[email protected]> wrote:
>>> > I have also the same problem
>>>
>>> --
>>> If you want to report a vulnerability issue on symfony, please send it to
>>> security at symfony-project.com
>>>
>>> You received this message because you are subscribed to the Google
>>> Groups "symfony developers" group.
>>> To post to this group, send email to [email protected]
>>> To unsubscribe from this group, send email to
>>> [email protected]<symfony-devs%[email protected]>
>>> For more options, visit this group at
>>> http://groups.google.com/group/symfony-devs?hl=en
>>>
>>
>>
>>
>> --
>> Raphael Almeida Araújo
>> Homepage: http://sites.google.com/site/raphoxaraujo
>>
>> --
>> If you want to report a vulnerability issue on symfony, please send it to
>> security at symfony-project.com
>>
>> You received this message because you are subscribed to the Google
>> Groups "symfony developers" group.
>> To post to this group, send email to [email protected]
>> To unsubscribe from this group, send email to
>> [email protected]<symfony-devs%[email protected]>
>> For more options, visit this group at
>> http://groups.google.com/group/symfony-devs?hl=en
>>
>
> --
> If you want to report a vulnerability issue on symfony, please send it to
> security at symfony-project.com
>
> You received this message because you are subscribed to the Google
> Groups "symfony developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<symfony-devs%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/symfony-devs?hl=en
>
--
Raphael Almeida Araújo
Homepage: http://sites.google.com/site/raphoxaraujo
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en