This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 218607 - PHPUnit 3.7 not working due to incorrect parameter
Summary: PHPUnit 3.7 not working due to incorrect parameter
Status: VERIFIED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: PHPUnit (show other bugs)
Version: 7.3
Hardware: All All
: P2 normal (vote)
Assignee: Tomas Mysik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-19 11:45 UTC by Vladimir Riha
Modified: 2012-10-11 11:56 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Riha 2012-09-19 11:45:58 UTC
If I found the correct piece of code, then NetBeans invokes following command to run PHPUnit tests:

phpunit --log-junit /tmp/nb-phpunit-log.xml NetBeansSuite /home/vriha/nbbuild6/php/phpunit/NetBeansSuite.php run=/var/www/PhpProject14/tests/CalcTest.php 


which fails with PHPUnit 3.7 with error msg: "More than two positional arguments provided". This message is used if condition on this [1] line is true. In case above, the array $this->options[1] contains following:
    [0] => NetBeansSuite
    [1] => /home/vriha/nbbuild6/php/phpunit/NetBeansSuite.php
    [2] => run=/var/www/PhpProject14/tests/CalcTest.php

removing the "NetBeansSuite" argument from the command fixes the problem but I'm not sure what else this could cause. The array above is same with PHPUnit 3.6 so I tried to remove code between lines 518 and 525 in [2] and thus "simulate" 3.6 and it seems to work, all tests were executed.


[1] https://github.com/sebastianbergmann/phpunit/blob/master/PHPUnit/TextUI/Command.php#L520
[2] https://github.com/sebastianbergmann/phpunit/blob/master/PHPUnit/TextUI/Command.php#L518
Comment 1 Vladimir Riha 2012-09-19 11:48:40 UTC
just a comment: I haven't found usage of options[1][2] where the actual CalcTest is. This argument seems to be used for NetBeansSuite.php and it wasn't problem until PHPUnit started to check number of parameters
Comment 2 Tomas Mysik 2012-09-19 11:54:31 UTC
Yes, I have investigated it as well and got to the same conclusion. So, as a hot fix for Beta, I will just remove the "NetBeansSuite" parameter. But this needs to be deeply investigated.

Thanks.
Comment 3 Tomas Mysik 2012-09-19 12:15:59 UTC
Hot fixed.

http://hg.netbeans.org/web-main/rev/8329ea6b2792
Comment 4 Tomas Mysik 2012-09-19 12:17:01 UTC
BTW I have reported an issue for PHPUnit [1].

[1] https://github.com/sebastianbergmann/phpunit/issues/655
Comment 5 Quality Engineering 2012-09-20 02:23:57 UTC
Integrated into 'main-golden', will be available in build *201209200001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/8329ea6b2792
User: Tomas Mysik <tmysik@netbeans.org>
Log: #218607 - PHPUnit 3.7 not working due to incorrect parameter
Comment 6 Vladimir Riha 2012-09-20 10:25:23 UTC
Fix looks OK, I tried code coverage, test creation (single file/folder), running tests (single test/folder) and it all looks fine (I reported issue 218675 for Skeleton Generator)


Product Version: NetBeans IDE Dev (Build 201209200001)
Updates: Updates available
Java: 1.7.0_07; Java HotSpot(TM) Client VM 23.3-b01
System: Linux version 3.2.0-30-generic-pae running on i386; UTF-8; en_US (nb)
Comment 7 Tomas Mysik 2012-10-03 09:24:50 UTC
Láďo, since issue I have reported against PHPUnit [1] has been closed, can you please verify that PHPUnit 3.7.x works again even in NB 7.2?

Thanks.
[1] https://github.com/sebastianbergmann/phpunit/issues/655
Comment 8 Tomas Mysik 2012-10-03 09:26:37 UTC
(In reply to comment #7)
> PHPUnit 3.7.x works again even in NB 7.2?

Version 3.7.1 does not work so it will be likely part of 3.7.2.
Comment 9 Vladimir Riha 2012-10-03 09:32:11 UTC
I'll try it as soon as it is out. If it will work, do you think this fix still should go to patch?
Comment 10 Tomas Mysik 2012-10-03 10:03:38 UTC
I would backport it in any case - it is a simple change and we cannot push users to use the latest available version.
Comment 11 Tomas Mysik 2012-10-09 10:03:27 UTC
Transplanted.

http://hg.netbeans.org/releases/rev/8311775882b1
Comment 12 Quality Engineering 2012-10-10 14:16:54 UTC
Integrated into 'releases', will be available in build *201210100934* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/8311775882b1
User: Tomas Mysik <tmysik@netbeans.org>
Log: #218607 - PHPUnit 3.7 not working due to incorrect parameter
(transplanted from 8329ea6b27927a51e605fb989df8bf45b357d943)
Comment 13 Vladimir Riha 2012-10-11 09:01:05 UTC
verified in patch

Product Version: NetBeans IDE 7.2.1 (Build 201210100934)
Java: 1.7.0_07; Java HotSpot(TM) Client VM 23.3-b01
System: Linux version 3.2.0-31-generic-pae running on i386; UTF-8; en_US (nb)


(In reply to comment #7)
> Láďo, since issue I have reported against PHPUnit [1] has been closed, can you
> please verify that PHPUnit 3.7.x works again even in NB 7.2?

I just noticed PHPUnit is in 3.7.7, I'll try it with NetBeans 7.2 later today
Comment 14 Vladimir Riha 2012-10-11 11:56:05 UTC
combination of PHPUnit 3.7.7 and NB 7.2 seems to be OK