Yii Framework Forum: NetBeans IDE and Test Driven Development - Yii Framework Forum

Jump to content

  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

NetBeans IDE and Test Driven Development Rate Topic: -----

#21 User is offline   Jampire 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 53
  • Joined: 10-January 11
  • Location:Gomel, Belarus

Posted 20 January 2012 - 01:59 AM

View Postzipzap, on 19 January 2012 - 05:12 PM, said:

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.


Posted Image
0

#22 User is offline   zipzap 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 314
  • Joined: 13-January 12

Posted 20 January 2012 - 03:00 PM

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);


View PostJampire, on 20 January 2012 - 01:59 AM, said:

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


PS. This may not work.

0

#23 User is offline   Jampire 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 53
  • Joined: 10-January 11
  • Location:Gomel, Belarus

Posted 23 January 2012 - 04:59 AM

View Postzipzap, on 20 January 2012 - 03:00 PM, said:

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?



Posted Image
0

#24 User is offline   Stageline 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 15
  • Joined: 03-February 12

Posted 19 February 2012 - 03:34 PM

The "chain" autocomplete does not work for me.

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

Any idea?
0

#25 User is offline   Luis Lobo Borobia 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 34
  • Joined: 25-March 10
  • Location:Buenos Aires

Posted 13 April 2012 - 11:06 PM

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.

This post has been edited by Luis Lobo Borobia: 13 April 2012 - 11:08 PM

Posted Image
The Social Network for Artists
0

#26 User is offline   Aigor 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 26-January 11

Posted 17 April 2012 - 12:46 PM

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.yiiframew...-yii-projects/.
Thanks

[Solved]
I had bad include file in config/main.php.
0

#27 User is offline   marcovtwout 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 78
  • Joined: 16-September 10
  • Location:Delft, NL

Posted 22 May 2012 - 09:42 AM

I discovered the advantages of using code templates and added some information to the wiki page about it. See if you like it. :)
Yii-Environment Extension - Predefine configurations for use in different environments, like development, testing, staging and production.
NetBeans IDE and Yii projects - Short directions and general tips for managing a Yii application in NetBeans IDE
0

#28 User is offline   Xerdos 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 21-December 10

Posted 30 July 2012 - 12:46 PM

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.yiiframew...-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
0

#29 User is offline   Seal 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 126
  • Joined: 02-February 10

Posted 01 August 2012 - 06:57 PM

@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.
Sylvester La-Tunje

Posted Image
0

#30 User is offline   APer 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 13-December 11

Posted 20 September 2012 - 11:32 PM

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?
0

#31 User is offline   Preacher 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 74
  • Joined: 01-October 11

Posted 14 May 2014 - 04:03 PM

PS
netbeans.yii.codetemplates.v2.zip

Referenced
http://fbe.am/hly
http://www.yiiframew...d-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>

0

Share this topic:


  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users