Class PHPUnit_TestCase

Description

Adapter for PEAR PHPUnit test case to allow legacy PEAR test cases to be used with SimpleTest.

Located in /extensions/pear_test_case.php (line 24)

SimpleTestCase
   |
   --PHPUnit_TestCase
Method Summary
 PHPUnit_TestCase __construct ([$label $label = false])
 void assertEquals ($first $first, $second $second, [$message $message = "%s"], [ $delta = 0])
 void assertFalse ($condition $condition, [$message $message = "%s"])
 void assertNotNull ($value $value, [$message $message = "%s"])
 void assertNotSame ($first $first, $second $second, [$message $message = "%s"])
 void assertNull ($value $value, [$message $message = "%s"])
 void assertRegExp ($pattern $pattern, $subject $subject, [$message $message = "%s"])
 void assertSame ($first $first, $second $second, [$message $message = "%s"])
 void assertTrue ($condition $condition, [$message $message = "%s"])
 void assertType ($value $value, $type $type, [$message $message = "%s"])
 Usually countTestCases ()
 void getName ()
 void setLooselyTyped ($loosely_typed $loosely_typed)
 void setName ($name $name)
Variables

Inherited Variables

Inherited from SimpleTestCase

SimpleTestCase::$reporter
Methods
Constructor __construct (line 32)

Constructor. Sets the test name.

  • public:
PHPUnit_TestCase __construct ([$label $label = false])
  • $label $label: Test name to display.

Redefinition of:
SimpleTestCase::__construct()
Sets up the test with no display.
assertEquals (line 45)

Will test straight equality if set to loose typing, or identity if not.

  • public:
void assertEquals ($first $first, $second $second, [$message $message = "%s"], [ $delta = 0])
  • $first $first: First value.
  • $second $second: Comparison value.
  • $message $message: Message to display.
  • $delta
assertFalse (line 132)

Sends pass if the test condition resolves false, a fail otherwise.

  • public:
void assertFalse ($condition $condition, [$message $message = "%s"])
  • $condition $condition: Condition to test false.
  • $message $message: Message to display.
assertNotNull (line 60)

Passes if the value tested is not null.

  • public:
void assertNotNull ($value $value, [$message $message = "%s"])
  • $value $value: Value to test against.
  • $message $message: Message to display.
assertNotSame (line 101)

Inverted identity test.

  • public:
void assertNotSame ($first $first, $second $second, [$message $message = "%s"])
  • $first $first: First object handle.
  • $second $second: Hopefully a different handle.
  • $message $message: Message to display.
assertNull (line 70)

Passes if the value tested is null.

  • public:
void assertNull ($value $value, [$message $message = "%s"])
  • $value $value: Value to test against.
  • $message $message: Message to display.
assertRegExp (line 143)

Tests a regex match. Needs refactoring.

  • public:
void assertRegExp ($pattern $pattern, $subject $subject, [$message $message = "%s"])
  • $pattern $pattern: Regex to match.
  • $subject $subject: String to search in.
  • $message $message: Message to display.
assertSame (line 81)

Identity test tests for the same object.

  • public:
void assertSame ($first $first, $second $second, [$message $message = "%s"])
  • $first $first: First object handle.
  • $second $second: Hopefully the same handle.
  • $message $message: Message to display.
assertTrue (line 121)

Sends pass if the test condition resolves true, a fail otherwise.

  • public:
void assertTrue ($condition $condition, [$message $message = "%s"])
  • $condition $condition: Condition to test true.
  • $message $message: Message to display.
assertType (line 154)

Tests the type of a value.

  • public:
void assertType ($value $value, $type $type, [$message $message = "%s"])
  • $value $value: Value to take type of.
  • $type $type: Hoped for type.
  • $message $message: Message to display.
countTestCases (line 175)

For progress indication during a test amongst other things.

  • return: one.
  • public:
Usually countTestCases ()
getName (line 184)

Accessor for name, normally just the class name.

  • public:
void getName ()
setLooselyTyped (line 165)

Sets equality operation to act as a simple equal comparison only, allowing a broader range of matches.

  • public:
void setLooselyTyped ($loosely_typed $loosely_typed)
  • $loosely_typed $loosely_typed: True for broader comparison.
setName (line 193)

Does nothing. For compatibility only.

  • public:
void setName ($name $name)
  • $name $name: Dummy

Inherited Methods

Inherited From SimpleTestCase

 SimpleTestCase::__construct()
 SimpleTestCase::after()
 SimpleTestCase::assert()
 SimpleTestCase::before()
 SimpleTestCase::createInvoker()
 SimpleTestCase::dump()
 SimpleTestCase::error()
 SimpleTestCase::exception()
 SimpleTestCase::fail()
 SimpleTestCase::getAssertionLine()
 SimpleTestCase::getLabel()
 SimpleTestCase::getSize()
 SimpleTestCase::getTests()
 SimpleTestCase::isTest()
 SimpleTestCase::pass()
 SimpleTestCase::run()
 SimpleTestCase::setUp()
 SimpleTestCase::shouldSkip()
 SimpleTestCase::signal()
 SimpleTestCase::skip()
 SimpleTestCase::skipIf()
 SimpleTestCase::skipUnless()
 SimpleTestCase::tearDown()
 SimpleTestCase::tell()

Documentation generated on Sun, 31 Oct 2010 16:31:55 -0500 by phpDocumentor 1.4.3