Fatal error when PHPUnit is not installed
PHPUnit and vfs(stream) are no longer included with the FLOW3 distribution.
But still, the core relies on those libraries.
Running FLOW3 without the respective PEAR packages installed, PHP dies with a fatal error:
Fatal error: require_once() [function.require]: Failed opening required 'PHPUnit/Autoload.php'
IIRC the plan is to get rid of the dependency (as long as you don't want to run the unit tests of course).
But anyways, the fatal error should be avoided by checking for the existence of the required PEAR packages IMO
Updated by Karsten Dambekalns about 11 years ago
- Status changed from Accepted to Needs Feedback
The problem consists of two parts.
- The BaseTestCase (and it's two friends FunctionalTestCase and SeleniumTestCase) need PHPUnit
- The web-based testrunner needs PHPUnit
The first one is easily solved by moving those to the Build/Common/PhpUnit/ folder. They can then be included by the respective bootstrap files so there is never a need to include them some other way. Nice.
The testrunner still needs to be solved. Options:
- Require people to install PHPUnit. Con: obviously not pratical
- Ship a PackageStates.yaml that disables Testing. Con: some time ago we removed PackageStates.yaml from the distributions and create it upon first hit if not yet existent.
- Add PEAR dependency checking to the package manager and ignore packages with missing dependencies when creating PackageStates.yaml for the first time.
I wanted to do the dependency checking, but that is where the shit hits the fan. Using PEAR checking for installed packages is not possible says Robert, and it would also be a dead end, as Pyrus (PEAR2) is on the horizon.
Pyrus looks really nice, it is packaged in one phar file and I even managed to use it for dependency checking. Needs some polishing and could be pushed for review. But it is not a solution... because you still need to configure Pyrus before it makes sense. Because without being configured it does not know where PEAR packages would be installed and where the channel registry is. Thus it cannot check for any installed package.Which leaves us where we started: the user needs to fix things before running into problems. Now what? Solutions, ordered by niceness:
- Remove the Testing package completely
- Ship a PackageStates.yaml that makes testing inactive
Please choose... (I favour 1)