PHPUnit_Framework_TestResult::convertErrorsToExceptions PHP Method

convertErrorsToExceptions() public method

Enables or disables the error-to-exception conversion.
public convertErrorsToExceptions ( boolean $flag )
$flag boolean
    public function convertErrorsToExceptions($flag)
    {
        if (!is_bool($flag)) {
            throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'boolean');
        }
        $this->convertErrorsToExceptions = $flag;
    }

Usage Example

Beispiel #1
0
 public function doEnhancedRun(\PHPUnit_Framework_Test $suite, \PHPUnit_Framework_TestResult $result, array $arguments = array())
 {
     unset($GLOBALS['app']);
     // hook for not to serialize globals
     $arguments = array_merge($this->defaultArguments, $arguments);
     $this->handleConfiguration($arguments);
     $result->convertErrorsToExceptions(false);
     if ($arguments['report']) {
         $this->printer = new Report();
     }
     if (empty(self::$persistentListeners)) {
         $this->applyReporters($result, $arguments);
     }
     $arguments['listeners'][] = $this->printer;
     // clean up listeners between suites
     foreach ($arguments['listeners'] as $listener) {
         $result->addListener($listener);
     }
     $suite->run($result, $arguments['filter'], $arguments['groups'], $arguments['excludeGroups'], $arguments['processIsolation']);
     unset($suite);
     foreach ($arguments['listeners'] as $listener) {
         $result->removeListener($listener);
     }
     return $result;
 }
All Usage Examples Of PHPUnit_Framework_TestResult::convertErrorsToExceptions