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 245179 - Parameters of PHPUnit Skeleton generator changed in 2.0.x
Summary: Parameters of PHPUnit Skeleton generator changed in 2.0.x
Status: VERIFIED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: PHPUnit (show other bugs)
Version: 8.0
Hardware: All All
: P2 normal (vote)
Assignee: Tomas Mysik
URL:
Keywords:
: 245175 245281 247162 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-06-22 12:38 UTC by afrawan_artisan
Modified: 2016-03-14 06:19 UTC (History)
6 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
When trying to run Test case PHPUnit , it pop ups ( [InvalidArgumentException] Command "Calculator" is not defined. ) (104.60 KB, image/png)
2014-07-25 05:05 UTC, naveenyalla
Details

Note You need to log in before you can comment on or make changes to this bug.
Description afrawan_artisan 2014-06-22 12:38:47 UTC
Hi all,

From version 2.0.x of PHPUnit Skeleton generator tool, the parameters changed.

Based on php.phpunit/src/org/netbeans/modules/php/phpunit/commands/SkeletonGenerator.java, in 'params' definition :

- BOOTSTRAP_PARAM = "--bootstrap"; // Unchanged
- TEST_PARAM = "--test"; // From 2.0.x -> TEST_PARAM = "generate-test"
- SEPARATOR_PARAM = "--"; // There is no separator param

Before 2.0.x : 
"/usr/bin/php" "/var/www/project/vendor/bin/phpunit-skelgen" "--bootstrap" "/var/www/project/tests/bootstrap.php" "--test" "--" "Project\User" "/var/www/project/src/Project/User.php" "Project\UserTest" "/var/www/project/tests/src/Project/UserTest.php"

From 2.0.x : 
"/usr/bin/php" "/var/www/project/vendor/bin/phpunit-skelgen" generate-test --bootstrap="/var/www/project/tests/bootstrap.php" "Project\User" "/var/www/project/src/Project/User.php" "Project\UserTest" "/var/www/project/tests/src/Project/UserTest.php"

Maybe, it will be interesting to handle the two versions in this file.

Best regards.
Comment 1 Tomas Mysik 2014-06-23 04:52:15 UTC
We definitely need to solve this, thanks for catching it.
Comment 2 Tomas Mysik 2014-06-24 12:14:34 UTC
Done. Both version 1 and 2 are supported now (including a bootstrap file).

Thanks.

http://hg.netbeans.org/web-main/rev/a70eae4987f4
http://hg.netbeans.org/web-main/rev/2c31d1c69e08
Comment 3 afrawan_artisan 2014-06-24 16:04:51 UTC
Nice job Tomas.
Comment 4 Tomas Mysik 2014-06-24 16:08:45 UTC
(In reply to afrawan_artisan from comment #3)
> Nice job Tomas.

Thanks! It would be great if you could try it (simply wait for a message which will appear here telling where to download a dev build of NetBeans with this change).

Thanks.
Comment 5 Quality Engineering 2014-06-25 02:30:50 UTC
Integrated into 'main-silver', will be available in build *201406250001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/a70eae4987f4
User: Tomas Mysik <tmysik@netbeans.org>
Log: #245179 - Parameters of PHPUnit Skeleton generator changed in 2.0.x
Comment 6 Vladimir Riha 2014-06-27 18:17:02 UTC
*** Bug 245281 has been marked as a duplicate of this bug. ***
Comment 7 Vladimir Riha 2014-06-30 06:57:42 UTC
Verified, both old 1.2.1 and new 2.0.x work fine

Product Version: NetBeans IDE Dev (Build 201406300002)
Java: 1.8.0_05; Java HotSpot(TM) Client VM 25.5-b02
Runtime: Java(TM) SE Runtime Environment 1.8.0_05-b13
System: Linux version 3.13.0-29-generic running on i386; UTF-8; en_US (nb)
Comment 8 Tomas Mysik 2014-07-07 05:11:25 UTC
*** Bug 245175 has been marked as a duplicate of this bug. ***
Comment 9 naveenyalla 2014-07-25 05:05:28 UTC
Created attachment 148294 [details]
When trying to run Test case PHPUnit , it pop ups (  [InvalidArgumentException]               Command "Calculator" is not defined.                                           )

When trying to run Test case PHPUnit , it pop ups (  [InvalidArgumentException]               Command "Calculator" is not defined.                                           )

PHPUnit version = PHPUnit 4.1.4 by Sebastian Bergmann.
Skele generator = phpunit-skelgen version 2.0.1
Comment 10 naveenyalla 2014-07-25 05:27:33 UTC
Comment on attachment 148294 [details]
When trying to run Test case PHPUnit , it pop ups (  [InvalidArgumentException]               Command "Calculator" is not defined.                                           )

SOLVED
BUG CLOSED
Comment 11 Tomas Mysik 2014-07-25 05:37:44 UTC
@naveenyalla: Not sure what you mean by your comments but you need a dev version of NetBeans, of course (get it from the link in comment #5).

Thanks.
Comment 12 Tomas Mysik 2014-09-17 07:43:13 UTC
*** Bug 247162 has been marked as a duplicate of this bug. ***
Comment 13 dariuszbruj 2016-03-12 22:31:26 UTC
I think something was changes in PHPUnit Skeleton, becouse it stopped to work for me. I definied a bootstrap file and it is connected to PHPUnit, tests are running OK.


The NetBeans generate this path, which doesn't work:
"C:\Users\Dariusz Bruj\AppData\Roaming\Composer\vendor\bin\phpunit-skelgen-2.0.bat" "--ansi" "generate-test" "SurveyController" "E:\CloudStation\Praca\ARCHEMIA\website\app\controllers\SurveyController.php" "SurveyControllerTest" "E:\CloudStation\Praca\ARCHEMIA\website\test\app\controllers\SurveyControllerTest.php

When i insert a bootstrap parameter it works:
"C:\Users\Dariusz Bruj\AppData\Roaming\Composer\vendor\bin\phpunit-skelgen-2.0.bat" generate-test --bootstrap "E:\CloudStation\Praca\ARCHEMIA\website\test\bootstrap.php" --ansi "SurveyController" "E:\CloudStation\Praca\ARCHEMIA\website\app\controllers\SurveyController.php" "SurveyControllerTest" "E:\CloudStation\Praca\ARCHEMIA\website\test\app\controllers\SurveyControllerTest.php"


I would like you to resolve this problem. Thanks in advance!
Comment 14 Tomas Mysik 2016-03-14 06:18:55 UTC
@dariuszbruj: Please, do not reopen VERIFIED issues. Simply report a new one instead. BTW it seems to be a problem in your IDE setup - you must check "Use Bootstrap for Creating New Unit Tests" checkbox in your Project Properties (category PHPUnit). Or define bootstrap in your PHPUnit XML configuration. Last note: _always_ attach your IDE log [1] and also provide exact error message.

Thanks.
[1] http://wiki.netbeans.org/FaqLogMessagesFile