PHPUnit 3.6.10 + ZendFramework 1.11.11 + NetBeans 7.1 - zend-framework

When I create a controller with following through Zend_Tool
command:
create controller NameController
... netbeans creates a new controller successfully. BUT, it sends a message in the output window:
PHPUnit is required in order to generate controller test stubs.
How do I get Netbeans to automatically create a class with phpunit testing? I searched the net and thousands solutions so far not able to solve ...
Important Notes:
Have already installed the pear
Already installed phpunit
Already included 'phpunit' in the include_path
Has created a file and includes zf.ini too in the include_path
Options already configured netbeans, where I informed the directory phpunit.bat.
Is it a bug in NetBeans?
See:

I don't think it's so much a Neatbeans issue as it is a Zend_Tool (zf.bat) issue.
You are likely working with a project that was built by Zend_Tool before phpunit was installed properly.
In this case the portion or your .zfproject.xml does not have the required information to utilize phpunit.
Netbeans does not actually do anything with Zend_Tool other then to provide a graphical interface.
I wish I had a quick fix for this problem, but I don't. I have solved this in the past by:
Make sure phpunit is properly setup and working in Netbeans
Now you have 2 choices:
Remake your project directory with Zend_Tool and let the .zfproject.xml file be generated with a working phpunit.(This works well with new projects)
Make a new project with Zend_Tool, look at the .zfproject.xml with an editor and change the .zfproject.xml for your project to include the phpunit info. This method may take a bit of trial and error to get correct.
To be complete here is an excerpt from one of my .zfproject.xml files:
<testsDirectory>
<testPHPUnitConfigFile filesystemName="phpunit.xml"/>
<testPHPUnitBootstrapFile filesystemName="bootstrap.php"/>
<testApplicationDirectory>
<testApplicationControllerDirectory>
<testApplicationControllerFile forControllerName="Index"/>
</testApplicationControllerDirectory>
</testApplicationDirectory>
<testLibraryDirectory/>
</testsDirectory>
I haven't found a way to regenerate the .zfproject.xml file to reflect changes to the environment.
I hope someone else has an easier fix...

I found a solution.
In c:/user/you profile user/.zf.ini, the config file was like this:
php.include_path = ".C:/wamp/bin/php/php5.3.8/pear/PHPUnit;C:/Program Files/NetBeans 7.1/php/zend;C:/wamp/apps/ZendFramework/library"
basicloader.classes.0 = "NetBeansCommandsProvider"
I took the php.include_path, leaving the file as follows:
basicloader.classes.0 = "NetBeansCommandsProvider"
Well .. this is crazy and did not understand because it worked well for me.
NOTE: Please note that settings should already be set include_path in php.ini in the C:\wamp\bin\php\php5.3.8 and C:\wamp\bin\apache\Apache2.2.21\bin
Thanks to all!

Related

PHPUnit was not found in your include_path, therefore no testing actions will be created

I created a new Zend framework 1 project (I need to learn ZF1 for a old app I'll be working on) using the following command: zf create project zf-tutorial
... but I get an error telling me: PHPUnit was not found in your include_path, therefore no testing actions will be created.
However, I have phpunit installed and I can confirm this by going to the terminal and running phpunit
I installed PHPUnit from their homepage - http://phpunit.de/manual/4.1/en/installation.html
I suspect that zf create * will generate my test files/folders similar to Rails? I really like this feature and would like to enable it for ZF too (if possible)
Any reason why zend tool isn't picking up phpunit?
Maybe put the path where the phpunit is located into your include_path in your php.ini file? phpunit may be in your shell PATH but might not be in the include_path...

Where is the phpunit.php file?

I'm trying to set up Eclipse to be able to debug PHPUnit tests. I'm trying to follow the instructions here. It says to set up a new Run Configuration, and choose PHP script, and the php file should be phpunit.php
My problem is, I can't find that file anywhere! Does the new version of PHPUnit not come with such a file? How else can you debug the unit tests?
Thanks
The file that the IDE is looking for is a single file that can run all the tests. One convention in the PHPUnit community is to call that file AllTests.php.
Kristian from Denmark explains this in an article that covers more than that.
Hope this helps!

Creating a zend project on Zend Studio 9.0.1

I've just installed the latest Zend Studio along with the latest zend server on my PC (windows 7 - 64 bit).
Now I'm trying to create a zend framework project by creating a NEW -> Local PHP Project , choosing a zend framework in location :
C:\Program Files (x86)\Zend\Apache2\htdocs
which is by default my localhost folder.And finally when the project created all I get is 3 included libraries :
Javascript Resources , PHP Include Path , PHP Language Library.
And No additional folders created.
But What with the basic structure of the zend project ?
How can I create the default "Template" zend project ?
UPDATE: Glad you managed to resolve the issue, All the best. Dave
I just tried going through the process and it worked fine for me creating the extra folders.
Just check you selected the right option when going through the wizard as Zend Framework needs to be selected (see image below).
You could try using Zend Tool instead if that doesn't work.
The documentation is here if you haven't used it before - also loads of tutorials online you can watch too.
When you create a new controller using it, you can have it automatically create an index action and index view created.
Likewise if you create a new action in a controller using it the view can be created automatically saving you some time.
If that doesn't work for you either, you may want to try reinstalling Zend Studio.
Hope this helps.
All the best,
Dave
Mystery was solved !
All I had to do is allow "WRITE" permission to my
C:\Program Files (x86)\Zend\Apache2\htdocs
folder.
That's it , so simple !

I can't get qml to use my custom plugin

I'm working in QtQuick and right now struggling with a weird problem: I can't get my custom plugin to work in Qml. There's a simple demo in the SDK (Examples/4.7/declarative/tutorials/extending/chapter6-plugins) and this doesn't work on my computer either. I don't get any error messages except that it doesn't recognize my custom items. Has anybody seen this problem? Any suggestions?
My setup:
Win 7 Home Premium, Qt Creator 2.1.0, Qt 4.7.3 (MinGW 4.4)
Thanks
Beside the qmldir issue already mentioned by blakharaz, also make sure to set QML_IMPORT_PATH in your pro file or setting the path via QDeclarativeEngine::addImportPath() so the module can be found on your development environment (if you don't install them systemwide before using).
And when using subfolders, make sure they are part of the import (see http://doc.qt.nokia.com/4.7-snapshot/qdeclarativemodules.html)
It would be nice to have some code. One possible issue could be the directory structure or the qmldir file. If you want to have a plugin called Foo you basically need a directory Foo which contains the Foo.dll (or libFoo.so) and a qmldir file (content is at least "plugin Foo")
If you have that "import Foo 1.0" should load the library.
I just had the exact same problem.
Build your .dlls as release instead of debug, that fixed it for me.

Problems with zend-tool reporting that providers are not valid

I have recently setup XAMPP 1.7.3 and ZendFramework 1.10.4 on a new computer and many of the commands that I normally use now fail.
Here are the steps I used to setup and test ZF.
First I added the ZF library folder (C:\xampp\php\ZendFramework-1.10.4\library) to the include path in php.ini.
Then I added the ZF bin folder (C:\xampp\php\ZendFramework-1.10.4\bin) to my Path system variable.
To test that everything is configured correctly I ran the command "zf show version" from the command line. The result is "Zend Framework Version: 1.9.6".
Immediately something appears to be wrong. The file that is downloaded is "ZendFramework-1.10.4.zip" and the reported version is 1.9.6. I have re-downloaded the latest version (1.10.4) and removed old copy. Still the incorrect version number problem persisted.
Having done some research there is a bug in the ZF knowledgebase that version 1.10.3 reports a wrong version number. So that may explain the version number problem.
Moving forward I tried to run some zf-tool commands and certain commands reports that the action or provider is not valid.
Example:
C:\xampp\htdocs>zf create project test
Creating project at C:/xampp/htdocs/test
C:\xampp\htdocs>cd test
C:\xampp\htdocs\test>zf create controller Test
Creating a controller at C:\xampp\htdocs\test/application/controllers/TestController.php
...
Updating project profile 'C:\xampp\htdocs\test/.zfproject.xml'
C:\xampp\htdocs\test>zf create action test Test
Creating an action named test inside controller at C:\xampp\htdocs\test/application/controllers/TestController.php
...
Updating project profile 'C:\xampp\htdocs\test/.zfproject.xml'
C:\xampp\htdocs\test>zf enable layout
An Error Has Occurred
Action 'enable' is not a valid action.
...
C:\xampp\htdocs\test>zf create form Test
An Error Has Occurred
Provider 'form' is not a valid provider.
...
Can any one provide insight into these errors and how to correct them?
I had a similar issue, it turned out that I needed to manually update the zf.bat and zf.php files that came included with xampp after updating to the latest zend framework.
I got them from the zend svn here: http://framework.zend.com/svn/framework/standard/trunk/bin/
the simple way if you are using xampp, just go to the path "xampp\php\PEAR" an replace the older Zend directory with all included files by a new one zend 1.10... dir and your porblems are lost :)
i think your problem is, that Zend Tool is shipped with xampp since some versions.
Try to find zf.bat in your Xampp directory and remove it ;)
ZF friends have written the worst kind of docs. For XAMPP user, it is more difficult. I have learning ZF and posting error getting on the path. I am also using XAMPP.
Your error list is very big. I hope I can help you.
Solution for error "An Error Has Occurred
Action 'enable' is not a valid action." is XAMPP's Zend Tool installation. Delete that.
Check here for more details about the solution and other possible errors: http://www.satya-weblog.com/2010/11/zend-framework-creating-layout.html.