-
Notifications
You must be signed in to change notification settings - Fork 283
Description
When running phpspec I see:
$ phpspec MySpec.php
PHP Fatal error: Class '\PHPSpec\Runner\Reporter\Console' not found in /usr/share/php/PHPSpec/Runner.php on line 91
$
OS: Ubuntu 9.10
PHP: 5.3.2
The code where the error happens is:
85: if (isset($options->reporter)) {
86: $reporterClass = "\PHPSpec\Runner\Reporter" .
87: ucfirst($options->reporter);
88: } else {
89: $reporterClass = "\PHPSpec\Runner\Reporter\Text";
90: }
91: $reporter = new $reporterClass($result);
This works fine with PHP 5.3.3 in MacOSX
I tried using reflection and using single quote instead of double. Because "reporter" is coming from the cli arguments it is given as a string, so no chance of pass the object directly. Eval works, but I'd rather not use it.
Maybe the solution would be a switch statement. Since it is already limited to the namespace \PHPSpec\Runner\Reporter anyway.