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

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

Related

ZF Error ZF tool setup

Zend 1.9.1
so I get this error
Blockquote
***************************** ZF ERROR ********************************
In order to run the zf command, you need to ensure that Zend Framework
is inside your include_path. If you are running this without Zendframework in your include-path, you can alternatively set one of two enviroment variables to for this tool to work
ZEND_TOOL_INCLUDE_PATH="/path/to/ZendFramework\library" or alternatively
ZEND_TOOL_INCLUDE_PATH_PREPEND="/path/to/ZendFramework\library"
attempted include_path: c:\php\includes;.
script location: c:\php\bin\zf.php
looking at the attempted include path it shows that my include path is set to 'c:\php\includes', done so via php.ini
inside include folder is 'library/' folder which contains 'zend/'
and my zend bin folder is at c:php/bin
yet I still get this error when trying to use zf in command line?
Ive had a look at other questions to no avail
I ended up using Zend Framework 1 final release - version 1.12.11 to get around this headache and it worked perfectlt as it should have. Had to be a bug in the 1.9 version!

PHPUnit 3.6.10 + ZendFramework 1.11.11 + NetBeans 7.1

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!

"zf create controller" not creating PHPUnit tests

Not quite sure why I'm not able to create PHPUnit tests automatically when I create a new Zend controller.
I'm working on Windows with XAMPP. I've installled PHPunit via pear and it's recognized in the command line (version 3.5.14)
The include_path in the php.ini contains c:\xampp\php\PEAR;c:\ZendFramework\library
I added this c:\ZendFramework\library as well to my PATH and ZEND_TOOL_INCLUDE_PATH variables.
But still when I create a new controller, no test cases are created with the following message:
Note: PHPUnit is required in order to generate controller test stubs.
Any idea of something I'm missing or I could try please?

Error with the ZF tool while setting up the GuestBook Application

Iam trying to set up the GuestBook Application which comes with zend framework tutorial , Iam following the steps one by one,
However when I enter this command - zf create db-table Guestbook guestbook
Iam getting an error, I have pasted the error here -
C:\xampp\htdocs\quickstart>zf create db-table Guestbook guestbook
An Error Has Occurred Provider 'db-table' is not a valid provider.
I tried googling and searching on zend forums, but seems no one got this sort of issue so far. Can anyone suggest me whats wrong here?
PS: I have set php in my system path and zf tool works for me, its only this specific command thats giving error.
After Lots of digging in and breaking my head with the ZF tool I found that it is using copy of Zend framework which comes with Xampp for Windows.
When I installed Xampp, Zend Framework(Version 1.9.7) got installed inside the
C:\Xampp\Php\Pear\Zend
directory and since C:\Xampp\Php is in my system path this Zend framework got picked up everytime by Zend Tool.
I copied the latest version of stable Zend Framework(1.10.2) to the Zend folder inside Php\Pear and now its works like cake for me :)
Thanks for all your suggestions!
Download latest version of framework files from this link http://www.zend.com/community/downloads & then extract zip file where you will get folder structure like ZendFramework-1.11.12/library/Zend, So from this folder copy Zend folder to Xampp/php/PEAR/zend folder. Then Go to command mode type Zf --help. Now it shows all the commands.
Now also check version of zend-framework in command mode by typing as
zf show version
it should show as version as zend Framework Version: 1.11.12
Check your version, maybe db-table is newer than your version. I just tried the same command you used (zf create db-table Guestbook guestbook) and it worked.
When i write zf show version it responds 1.11.0dev. What does your version say? If it's low, consider updating after following the changelog and testing the rest of your application with the new version of zf.

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.