Answer the question
In order to leave comments, you need to log in
How to add unit testing to an old project?
Hello!
A question. I am currently working on a project that has not been upgraded for 7 years. The current version of php is 5.2.17 . There was a need to add unit testing, but I ran into a problem: almost all testing tools require a new version of php (at least 5.3). There is no option to update the system now. In the process of searching, I found several solutions, but each with its own problems:
1) The most working one is to use SimpleTest. Concerning the php version - just right. The tests are running. However, the problem is that the project is very dimly maintained and will probably close soon, and sooner or later we will still have an update, we will want to use PHPUnit. Do not rewrite the same tests? I don't remember any other tools for Unit tests, but when I was looking, they also seemed to require something from PHP 5.3.3
2) Use PHPUnit version 3.4 (works from php 5.1+). The only problem is that it is not clear how to install. If you just download files from Github, then the problem arises with the paths, since there is something like this in each standard class file:
require_once 'PHPUnit/Framework.php';
require_once 'PHPUnit/Framework/MockObject/Generator.php';
require_once 'PHPUnit/Framework/MockObject/Matcher/InvokedAtLeastOnce.php';
require_once 'PHPUnit/Framework/MockObject/Matcher/InvokedAtIndex.php';
require_once 'PHPUnit/Framework/MockObject/Matcher/InvokedCount.php';
require_once 'PHPUnit/Framework/MockObject/Stub.php';
require_once 'PHPUnit/Runner/BaseTestRunner.php';
Of course, I can't download them. If there is a manual, I will be glad to link. $ pear config-set auto_discover 1
$ pear install --alldeps phpunit
The problem here is that PHPUnit 3.7 is being installed, which is already very late. Need 3.4. What to write is not clear. Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question