Bug #11207
Fatal error when PHPUnit is not installed
Status: | Resolved | Start date: | 2010-12-01 | |
---|---|---|---|---|
Priority: | Must have | Due date: | ||
Assigned To: | Karsten Dambekalns | % Done: | 100% |
|
Category: | - Testing - | |||
Target version: | TYPO3 Flow Base Distribution - 1.0 alpha 14 | |||
PHP Version: | Complexity: | |||
Has patch: | Affected Flow version: |
Description
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
Related issues
Associated revisions
[+BUGFIX] FLOW3 Distribution: Ship PackageStates.yaml
The fix for #3989 was to generate PackageStates.yaml and in August 2010
we had removed that file from the distribution.
With the dependency on PHPUnit being installed for the Testing package
this breaks if PHPUnit is not available, as we don't have dependency
checking. Thus add the file again and deactivate Testing in it.
Change-Id: Icf22efc1d0c786a1f052e1829676c40180b4c8c1
Fixes: #11207
History
#1 Updated by Robert Lemke over 4 years ago
- Target version set to 1.0 alpha 14
#2 Updated by Karsten Dambekalns over 4 years ago
- Status changed from New to Accepted
- Assigned To set to Karsten Dambekalns
#3 Updated by Karsten Dambekalns over 4 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)
#4 Updated by Karsten Dambekalns over 4 years ago
- Status changed from Needs Feedback to Under Review
#5 Updated by Karsten Dambekalns over 4 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Resolved by shipping a PackageStates.yaml with Testing disabled.