Show:

Q_TestCase Class

Module: Q

This class lets you run test cases

Methods

clear

(
  • string
)

Clears a fixture variable

Parameters:

  • string Object

    $name The name of the variable

get

(
  • $name
  • [$default=null]
)
Mixed

get a fixture variable

Parameters:

  • $name String
  • [$default=null] Mixed optional

Returns:

Mixed:

getAll

() Array

Gets all the fixture variables. Typically, you would do extract($this->getAll()) at the beginning of a test.

Returns:

Array:

restoreState

()

Restores the initial state of the State

run

() Array

Runs the tests

Returns:

Array:

$results Returns array of results. A result consists of

saveState

()

Saves the initial state of the State

set

(
  • $name
  • [$value=null]
)
Mixed

set up a fixture variable

Parameters:

  • $name String
  • [$value=null] Mixed optional

Returns:

Mixed:

testFailed

(
  • string
)

Call to indicate the test failed

Parameters:

  • string Object

    [$message="failed"] Optional custom message.

testIncomplete

(
  • string
)

Call to indicate the test is not yet completely written.

Parameters:

  • string Object

    [$message="incomplete"] Optional custom message.

testSkipped

(
  • string
)

Call to indicate the test was skipped

Parameters:

  • string Object

    [$message="skipped"] Optional custom message.

Properties

$saved_super_globals

Array private

Attributes

TEST_EXCEPTION

TEST_FAILED

TEST_INCOMPLETE

TEST_SKIPPED

TEST_SUCCEEDED