Version: current

# Class TestRunner

Controller that executes PHPUnit tests.

## URL Options

- SkipTests: A comma-separated list of test classes to skip (useful when running dev/tests/all)

See `TestRunner::browse()` output for generic usage instructions.

  Object
  ViewableData implements IteratorAggregate
  RequestHandler
  Controller
  TestRunner

Package: sapphire\testing
Located at sapphire/dev/TestRunner.php

## Methods summary

`public static` | # `set_reporter( string $reporter )` Override the default reporter with a custom configured subclass. Override the default reporter with a custom configured subclass. #### Parameters $reporter string $reporter
`public` | # `init( )` Initialisation function that is run before any action on the controller is called. Initialisation function that is run before any action on the controller is called. #### Uses ``BasicAuth::requireLogin()`` #### Overrides `Controller::init`
`public` | # `Link( )`
`public` | # `all( mixed $coverage = false )` Run test classes that should be run with every commit. Currently excludes PhpSyntaxTest Run test classes that should be run with every commit. Currently excludes PhpSyntaxTest
`public` | # `build( )` Run test classes that should be run before build - i.e., everything possible. Run test classes that should be run before build - i.e., everything possible.
`public` | # `browse( )` Browse all enabled test cases in the environment Browse all enabled test cases in the environment
`public` | # `coverageAll( )` Run a coverage test across all modules Run a coverage test across all modules
`public` | # `coverageOnly( mixed $request )` Run only a single coverage test class or a comma-separated list of tests Run only a single coverage test class or a comma-separated list of tests
`public` | # `coverageModule( mixed $request )` Run coverage tests for one or more "modules". A module is generally a toplevel folder, e.g. "mysite" or "sapphire". Run coverage tests for one or more "modules". A module is generally a toplevel folder, e.g. "mysite" or "sapphire".
`public` | # `cleanupdb( )`
`public` | # `only( mixed $request, mixed $coverage = false )` Run only a single test class or a comma-separated list of tests Run only a single test class or a comma-separated list of tests
`public` | # `module( mixed $request, mixed $coverage = false )` Run tests for one or more "modules". A module is generally a toplevel folder, e.g. "mysite" or "sapphire". Run tests for one or more "modules". A module is generally a toplevel folder, e.g. "mysite" or "sapphire".
`public` | # `runTests( array $classList, boolean $coverage = false )` #### Parameters $classList array $classList $coverage boolean $coverage
`public` | # `startsession( )` Start a test session. Usage: visit dev/tests/startsession?fixture=(fixturefile). A test database will be constructed, and your browser session will be amended to use this database. This can only be run on dev and test sites. Start a test session. Usage: visit dev/tests/startsession?fixture=(fixturefile). A test database will be constructed, and your browser session will be amended to use this database. This can only be run on dev and test sites.
`public` | # `endsession( )`
`public` | # `setUp( )`
`public` | # `tearDown( )`

### Methods inherited from Controller

`CurrentMember()`, `Now()`, `PastMember()`, `PastVisitor()`, `can()`, `curr()`, `defaultAction()`, `disableBasicAuth()`, `getAction()`, `getFormOwner()`, `getRequest()`, `getResponse()`, `getSession()`, `getURLParams()`, `getViewer()`, `handleAction()`, `handleRequest()`, `hasAction()`, `hasActionTemplate()`, `has_curr()`, `isAjax()`, `join_links()`, `popCurrent()`, `pushCurrent()`, `redirect()`, `redirectBack()`, `redirectedTo()`, `render()`, `setSession()`, `setURLParams()`

### Methods inherited from RequestHandler

`__construct()`, `allowedActions()`, `checkAccessAction()`, `httpError()`

### Methods inherited from ViewableData

`ATT_val()`, `BaseHref()`, `CSSClasses()`, `ColumnBreak()`, `ColumnCalc()`, `ColumnNumber()`, `ColumnPad()`, `ColumnPos()`, `CurrentPage()`, `Debug()`, `Even()`, `EvenOdd()`, `First()`, `FirstLast()`, `HasPerm()`, `IsAjax()`, `JS_val()`, `Last()`, `Me()`, `Middle()`, `MiddleString()`, `Modulus()`, `MultipleOf()`, `Odd()`, `Pos()`, `RAW_val()`, `SQL_val()`, `ThemeDir()`, `ThemeName()`, `Top()`, `TotalItems()`, `XML_val()`, `__get()`, `__isset()`, `__set()`, `buildCastingCache()`, `cachedCall()`, `castingClass()`, `castingHelper()`, `castingHelperPair()`, `castingObjectCreator()`, `castingObjectCreatorPair()`, `customise()`, `defineMethods()`, `escapeTypeForField()`, `getField()`, `getIterator()`, `getSecurityID()`, `getXMLValues()`, `hasField()`, `hasValue()`, `i18nLocale()`, `iteratorProperties()`, `obj()`, `renderWith()`, `setCustomisedObj()`, `setField()`

### Methods inherited from Object

`__call()`, `__toString()`, `__wakeup()`, `addMethodsFrom()`, `addStaticVars()`, `addWrapperMethod()`, `add_extension()`, `add_static_var()`, `allMethodNames()`, `cacheToFile()`, `cacheToFileWithArgs()`, `clearCache()`, `combined_static()`, `create()`, `createMethod()`, `create_from_string()`, `exists()`, `extInstance()`, `extend()`, `getCustomClass()`, `getExtensionInstance()`, `getExtensionInstances()`, `get_extensions()`, `get_static()`, `hasExtension()`, `hasMethod()`, `has_extension()`, `invokeWithExtensions()`, `is_a()`, `loadCache()`, `parentClass()`, `parse_class_spec()`, `remove_extension()`, `sanitiseCachename()`, `saveCache()`, `set_stat()`, `set_static()`, `set_uninherited()`, `stat()`, `strong_create()`, `uninherited()`, `uninherited_static()`, `useCustomClass()`

### Magic methods summary

## Properties summary

`public static array` | $url_handlers | # Default URL handlers - (Action)/(ID)/(OtherID) Default URL handlers - (Action)/(ID)/(OtherID)

### Properties inherited from Controller

`$action`, `$allowed_actions`, `$baseInitCalled`, `$basicAuthEnabled`, `$controller_stack`, `$request`, `$requestParams`, `$response`, `$session`, `$urlParams`

### Properties inherited from RequestHandler

`$brokenOnConstruct`

### Properties inherited from ViewableData

`$casting`, `$customisedObject`, `$default_cast`, `$failover`, `$iteratorPos`, `$iteratorTotalItems`

### Properties inherited from Object

`$class`, `$extension_instances`, `$extensions`

[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the Silverstripe Forums to ask development related questions. -