Using PHPUnit in cakephp

Source: Internet
Author: User
Tags pear

This problem toss a little time, so learn from the first flowchart

1. Installing Pear
1) on the command line, go to the PHP installation directory and run:

Go-pear.bat

(There may be error conditions)
2) Download Go-phar.bat to PHP installation directory and run:

PHP Go-pear.phar

3) Double-click on the newly generated Pear_env.reg to import the registry
4) At this time pear should be installed successfully, update to the latest version:

Pear Upgrade

(This step is very important, PHPUnit seems to use the Pear 1.9.x to install)

This section references the http://blog.csdn.net/calllmq/article/details/7865057

2, Installation PHPUnit

This section needs to pay attention to some things, the above article links in the method is not applicable in cakephp, according to the official manual of the wording

PEARConfig-1PEAR.  PHPUnit.  De/PHPUnit-3.7.               +




PHPUnit 4 is not compatible with CakePHP ' s Unit testing.

Depending on your system ' s configuration, the need to run the previous commands with sudo

Once PHPUnit is installed with the PEAR installer, you should confirm that the PHPUnit libraries be on PHP ' sinclude_p Ath. Checking your php.ini file and making sure that the PHPUnit files is in one of theinclude_path directories.

So I can't install version 4.0, and I need to add include_path, I added include_path or failed, mainly the reason of the path

First, the Include_path function is to simplify the requre when the path is found

cite a blog post

In the php.ini file can be set to include_path = ".; C:/xampp/xampp/php/pear "include_path =".; C:/aptana Studio Workspace/jsms "so that we can not write the path in the program can be directly included or require in the Jsms or Pear folder under the php file. The PHP code is as follows require_once (' jsms_conf.php ');  jsms_conf.php file under C:/aptana Studio workspace/jsms/

Because cakephp contains the phpunit/autoload.php.

So include_path must be in the PHPUnit of the upper level directory, such as my PHPUnit directory C:\wamp\bin\php\php5.4.3\pear\PHPUnit then set include_path include_ Path = ".; C:\wamp\bin\php\php5.4.3\pear "It's OK.

That's what happens when you're successful.

Using PHPUnit in cakephp

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.