Class CakeTestRunner

A custom test runner for CakePHP's use of PHPUnit.

PHPUnit_TextUI_TestRunner
Extended by CakeTestRunner
Package: Cake\TestSuite
Copyright: Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
License: MIT License
Location: Cake/TestSuite/CakeTestRunner.php

Method Summary

  • __construct() public
    Lets us pass in some options needed for CakePHP's webrunner.
  • Get the fixture manager class specified or use the default one.
  • createTestResult() protected
    Create the test result and splice on our code coverage reports.
  • doRun() public
    Actually run a suite of tests. Cake initializes fixtures here using the chosen fixture manager

Method Detail

__construct()source public

__construct( mixed $loader , array $params )

Lets us pass in some options needed for CakePHP's webrunner.

Parameters

mixed $loader
The test suite loader
array $params
list of options to be used for this run

_getFixtureManager()source protected

_getFixtureManager( array $arguments )

Get the fixture manager class specified or use the default one.

Parameters

array $arguments
The CLI arguments.

Returns

mixed
instance of a fixture manager.

Throws

RuntimeException
When fixture manager class cannot be loaded.

createTestResult()source protected

createTestResult( )

Create the test result and splice on our code coverage reports.

Returns

PHPUnit_Framework_TestResult

doRun()source public

doRun( PHPUnit_Framework_Test $suite , array $arguments array() , boolean $exit true )

Actually run a suite of tests. Cake initializes fixtures here using the chosen fixture manager

Parameters

PHPUnit_Framework_Test $suite
The test suite to run
array $arguments optional array()
The CLI arguments
boolean $exit optional true
Exits by default or returns the results

© 2005–2017 The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/2.10/class-CakeTestRunner.html