NetBeans IDE and Test Driven Development


I have installed netbeans v6.8,

Is there any reason for not upgrading to 6.9.1?

There’s no browse button in v6.8, seems they simply forgot it. ^^

Luckily that’s not much of a problem.

I’ve read the post about the problems with firefox, that’s why I also tried with chromium. Of course it’s possible that both browsers have the same problem, so at least I’m willing to upgrade the selenium server. The problem is, that I’ve no idea where those netbeans plugins get installed. And ekerazha mentioned, that one has to use the filename of the original file, which sounds to me as if it was something different that ‘selenium-server.jar’, so I have no clue what to search for. :unsure:

No specific reason, I simply installed it using synaptic. Now I updated to 6.9.1, and at least, there is the button that let’s me select the folder for unit tests in the settings dialog. But no luck with the functional tests till now.

Thanks for your replies! If anyone has more suggestions, please let me know.

You might want to do some changes:

0.- Rename your selenium-server.jar to selenium-server-1.0.1.jar and place it in your userdir by default it is in my widowsxp pc under C:\Documents and Settings\Bajja.ISSP_00\.netbeans\6.9\modules\ext\selenium

1.- Right click your project. Select PHPunit. Activate Use Bootstarp (and browse to you bootstarp file) and Use Bootstarp for creating New unit Tests.

2.- In WebTestCase.php change setUp:


    

protected function setUp()

    {

        parent::setUp();

        [b]$this->setBrowser('*chrome');[/b]

        $this->setBrowserUrl(TEST_BASE_URL);

    }

3.- In WebTestCase.php change


define('TEST_BASE_URL','http://localhost/[b]testdrive[/b]/index-test.php/'); //testdrive => must be your application.

If this does not work, please report your errors.

:lol: It’s working now!

The problem was the outdated selenium-server (1.0.1). I found it in ~/.netbeans/6.9/modules/ext/selenium (don’t know why my search didn’t show it, maybe it doesn’t search hidden folder by default? Have to check that…), replaced it with version 1.0.3 (named as ‘selenium-server-1.0.1.jar’), restarted netbeans (just in case) and voilà!

Thanks a lot!

By the way, has anyone of you run the SiteTest generated by yiic? To me, it reports one error:

see:

http://code.google.com/p/yii/issues/detail?can=2&q=1609&colspec=ID%20Type%20Status%20Priority%20Milestone%20Owner%20Stars%20Summary&id=1609

install PHPUnit on Xampp,but not working… help me

i try this … My link

You can start here: http://www.phpunit.de/manual/current/en/installation.html

And you have to be more clear about what steps you did and what results you get, ‘not working’ is not helping.

I figured out how to install NetBeans 7.0 with WAMP and PHPUnit. I will be posting a link soon. Was a pain but everything work as it is supposed now!

how do you do that?

im getting Fatal error: Class ‘CTestCase’ not found in netbeans

Right click on project name -> Project Properties -> PHPUnit -> Set to use bootstrap file protected/tests/bootstrap.php.

PS. This may not work.

Now i have this:

Warning: require_once(D:\xampp\htdocs\trackstar\protected\tests../../framework/yiit.php): failed to open stream: No such file or directory in D:\xampp\htdocs\trackstar\protected\tests\bootstrap.php on line 7

Fatal error: require_once(): Failed opening required ‘D:\xampp\htdocs\trackstar\protected\tests../../framework/yiit.php’ (include_path=’.;D:\xampp\php\PEAR’) in D:\xampp\htdocs\trackstar\protected\tests\bootstrap.php on line 7

my bootstrap file:


<?php


// change the following paths if necessary

$yiit=dirname(__FILE__).'../../framework/yiit.php';

$config=dirname(__FILE__).'/../config/test.php';


require_once($yiit);

require_once(dirname(__FILE__).'/WebTestCase.php');


Yii::createWebApplication($config);



You must correct $yiit and $config variables to point to right pathes. Where are your yiit.php and test.php files located?

The "chain" autocomplete does not work for me.

$cs = Yii::app()->clientScript-><ctrl>+<space> no suggestions

Any idea?

My solution for this topic is this one:

Create a new class that extends CWebApplication like the one below.




<?php

/**

 * @property CClientScript $clientScript

 * @property FCShowVideoClass $videoManager

 * @property CImageComponent $image

 * @property FCCloudFilesManager $cloudTv

 * @property FCCloudFilesManager $cloudImage

 * @property FCCloudFilesManager $cloudAudio

 * @property Curl $CURL

 * @property MailerMailCreator $mailCreator

 */

class FCWebApplication extends CWebApplication {

	/**

 	*  @return FCWebUser

 	*/

	public function getUser();

	

}



Then add a global function like the one below:




/**

 * This is the shortcut to Yii::app()

 * @return FCWebApplication

 */

function app()

{

	return Yii::app();

}



Notice the @return

Now, instead of using Yii::app(), use just app()-> <Ctrl>+<Space>

You will have code completion.

Hi

I Have this error: "No tests executed.(0,0 s)" and "Perhaps an error occurred, verify in Output window".

In php_error.log:

Class ‘WebTestCase’ not found …

My configuration is MAMP , Netbeans 7.1.1 (tried 7.2 and 7.0.1 but it’s the same), phpunit 3.6.10 and php 5.2.17.

I set bootstrap and xml configuration following http://www.yiiframework.com/wiki/83/netbeans-ide-and-yii-projects/.

Thanks

[Solved]

I had bad include file in config/main.php.

I discovered the advantages of using code templates and added some information to the wiki page about it. See if you like it. :)

Hi,

I have no other ideas so i’m asking you guys for help.

I have:

xampp 3.0.12

phpunit 3.6.11

php 5.4.4

netbeans 7.2

selenium installed from netbeans plugin

I followed all steps in: http://www.yiiframework.com/wiki/83/netbeans-ide-and-yii-projects/.

I used different modifications but i always get:

"No tests executed."

"Perhaps an error occurred, verify in Output window."

There are no errors.

Under "Tools > Options > PHP > Unit Testing"

PHPUnit Script x:\xampp\php\phpunit.bat

Skeleton Generator Script: (none)

Under "File > Project properties > Sources"

Test Folder: x:\xampp\htdocs\yii\trackstar\protected\tests\unit

Under "File > Project properties > PHPUnit"

Bootstrap: x:\xampp\htdocs\yii\trackstar\protected\tests\bootstrap.php

Use XML Configuration: x:\xampp\htdocs\yii\trackstar\protected\tests\phpunit.xml

@xerdos,

One common thing that pops to mind - your naming conventions.

How are your files and test named? Are they "PostTest.php" for files and "testReadNewCommemnt(){…}, having these conventions is how phpunit distinguishes a test file.

Hope this helps, let me know.

I had following everything in this thread, but PHPUnit still doesn’t work in my netbeans… it always return error “More than two positional arguments provided.”

So for now i used my shell for testing, can anyone provide best possible configuration for nunit to work with yii in netbeans?

PS

netbeans.yii.codetemplates.v2.zip

Referenced

http://fbe.am/hly

http://www.yiiframework.com/wiki/83/netbeans-ide-and-yii-projects/

Bogus:

File is not a zip file.

actually is a script

Kind of annoying seeing how it looks from the cheat sheet to be cool




<script type="text/javascript">


  var _gaq = _gaq || [];

  _gaq.push(['_setAccount', 'UA-1714314-2']);

  _gaq.push(['_trackPageview']);


  (function() {

    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;

    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';

    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);

  })();


</script>