Home  >  Article  >  Backend Development  >  phpstorm configures phpunit for php unit testing

phpstorm configures phpunit for php unit testing

不言
不言Original
2018-05-23 10:48:284246browse

phpstorm configures phpunit to perform php interface unit testing

1. Install php5.6, phpunit5.1, curl

mac comes with the default php5.5, which needs to be upgraded. Open the terminal and run:
curl -s http://php-osx.liip.ch/install.sh | bash -s 5.6

View the phpunit official website documentation and follow the document steps

wget https://phar.phpunit.de/phpunit.phar$ chmod +x phpunit.phar$ sudo mv phpunit.phar /usr/local/bin/phpunit
$ phpunit --version
PHPUnit 5.1.3 by Sebastian Bergmann and contributors

2. Download the phpunit.phar file, and then load it in phpstorm, as shown in the figure

phpstorm configures phpunit for php unit testing

The second one is the path of phpunit.phar
phpstorm configures phpunit for php unit testing

3. Load the phpunit installation directory:

phpstorm configures phpunit for php unit testing

4. Select the compiler

phpstorm configures phpunit for php unit testing

5 and simulate the access interface according to curl,

&#39;).addClass(&#39;pre-numbering&#39;).hide(); $(this).addClass(&#39;has-numbering&#39;).parent().append($numbering); for (i = 1; i <= lines; i++) { $numbering.append($(&#39;
&#39;).text(i)); }; $numbering.fadeIn(1700); }); });

The above introduces phpstorm to configure phpunit and conduct php unit testing, including the content. I hope it will be helpful to friends who are interested in PHP tutorials

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn