Answer the question
In order to leave comments, you need to log in
How to properly configure PHPStorm7 for PHPUnit?
I have PHPStorm 7 and want to learn PHPUnit testing. Never encountered any testing before and PHPStorm recently purchased.
The computer has Windows 7 and the Open Server server platform installed.
There are a lot of ways to install PHPUnit via PEAR in RuNet, but when running any test, PHPUnit reports that it will be supported via PEAR only until December 31, 2014 and therefore you need to install it via Composer or PHAR.
Open Server already has Composer and so I installed PHPUnit locally (in my project folder). Checked, everything works.
After that I decided to set up PHPStorm. But from the examples on the Internet I did not understand anything and it did not work.
If I understood correctly, then PHPUnit could not be installed at all, but download phpunit.phar and specify it in the PHPStorm settings (File>Settings>PHP>PHPUnit>Path to phpunit.phar)
Please tell us what and how to configure in PHPStorm7 for PHPUnit using the example of two files Money.php and MoneyTest.php from phpunit.de/getting-started.html .
And what should be in autoload.php and how to write it correctly?
Answer the question
In order to leave comments, you need to log in
Indeed - it's easiest with a .phar file in a specific project.
Set the PHPUnit version to 3.7.XX. With the fourth version in PHPStorm 7, there is still a bug with running tests (in PHPStorm 8 EAP, it seems to have been fixed). Everything works manually from the console, but from PHPStorm it swears.
How to start:
1. Create a project structure, as in the link you gave:
|-src
| |-autoload.php
| |-Money.php
|
|-tests
|-MoneyTest.php
<?php
require_once __DIR__ . '/Money.php';
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question