Class UnitTestCase

Description

Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.

Located in /libraries/pear/simpletest/unit_tester.php (line 24)

RunnableTest
   |
   --SimpleTestCase
      |
      --UnitTestCase
Direct descendents
Class Description
 class Dal_TestOfDal A class for testing the Dal class.
 class Dal_TestOfStatisticsAdServer A class for testing the Dal_Statistics_AdServer class.
 class Dal_TestOfStatistics A class for testing the Dal_Statistics class.
 class Dal_TestOfStatisticsCommon A class for testing the Dal_Statistics_Common class.
 class Dal_TestOfTableCore A class for testing the Dal_Table_Core class.
 class Dal_TestOfStatisticsAdServerSplit A class for testing the Dal_Statistics_AdServerSplit class.
 class Maintenance_TestOfStatisticsAdServer A class for testing the Maintenance_Statistics_AdServer class.
 class Maintenance_TestOfStatistics A class for testing the Maintenance_Statistics class.
 class Maintenance_TestOfTableStatistics A class for testing the Maintenance_Table_Statistics class.
 class Maintenance_TestOfMaintenance A class for testing the Maintenance class.
 class Maintenance_TestOfStatisticsCommon A class for testing the Maintenance_Statistics_Common class.
 class TestOfOptions Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfCompatibility Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfSimpleCookieJar Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfExpandomaticUrl Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfFetchingUrlParameters Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfAdditionalHeaders Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfBrowserCookies Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfHttpRedirects Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfBadHosts Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfAuthorisation Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfParallelRegex Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfStateStack Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfLexer Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfLexerModes Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfLexerHandlers Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfHtmlLexer Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfSaxGeneration Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfTextFormatting Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfWildcardExpectation Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfParametersExpectation Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfCallMap Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfStubGeneration Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfServerStubReturns Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfMockGeneration Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfMockReturns Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfMockTally Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfMockExpectations Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfPartialMocks Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class LiveHttpTestCase Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfNestingTags Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfXmlStructureParsing Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfXmlResultsParsing Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class QueryStringTestCase Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfUrl Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfEquality Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfInequality Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfIdentity Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfNonIdentity Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfPatterns Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfMethodExistence Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfIsA Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfNotA Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfUnitTestCaseOutput Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfMockObjectsOutput Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfPastBugs Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfShell Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfTag Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfWidget Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfTextArea Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfSelection Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfRadioGroup Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfTagGroup Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfForm Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfPageBuilder Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfPageParsing Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfErrorPage Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfPageHeaders Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfHtmlPage Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfForms Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfPageScraping Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfErrorQueue Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfErrorTrap Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfErrors Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfFrameset Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfFrameNavigation Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfFramesetPageInterface Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfCookie Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfDirectRoute Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfProxyRoute Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfHttpRequest Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfHttpHeaders Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfHttpResponse Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfRealm Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfAuthenticator Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfHistory Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfParsedPageAccess Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfBrowserNavigation Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfLiveBrowser Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfStickyError Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
Method Summary
 UnitTestCase UnitTestCase ([string $label = false])
 void assertCopy (mixed &$first, mixed &$second, [string $message = "%s"])
 void assertEqual (mixed $first, mixed $second, [string $message = "%s"])
 void assertError ([string $expected = false], [string $message = "%s"])
 void assertErrorPattern (mixed $pattern, [string $message = "%s"], string $expected)
 void assertIdentical (mixed $first, mixed $second, [string $message = "%s"])
 void assertIsA (mixed $object, string $type, [string $message = "%s"])
 void assertNoErrors ([string $message = "%s"])
 void assertNotEqual (mixed $first, mixed $second, [string $message = "%s"])
 void assertNotIdentical (mixed $first, mixed $second, [string $message = "%s"])
 void assertNotNull (mixed $value, [string $message = "%s"])
 void assertNoUnwantedPattern (string $pattern, string $subject, [string $message = "%s"])
 void assertNull (null $value, [string $message = "%s"])
 void assertReference (mixed &$first, mixed &$second, [string $message = "%s"])
 void assertWantedPattern (string $pattern, string $subject, [string $message = "%s"])
Variables

Inherited Variables

Inherited from SimpleTestCase

SimpleTestCase::$_reporter

Inherited from RunnableTest

RunnableTest::$_label
Methods
Constructor UnitTestCase (line 33)

Creates an empty test case. Should be subclassed with test methods for a functional test case.

  • access: public
UnitTestCase UnitTestCase ([string $label = false])
  • string $label: Name of test case. Will use the class name if none specified.
assertCopy (line 174)

Will trigger a pass if both parameters refer to different objects. Fail otherwise.

  • access: public
void assertCopy (mixed &$first, mixed &$second, [string $message = "%s"])
  • mixed $first: Object reference to check.
  • mixed $second: Hopefully not the same object.
  • string $message: Message to display.
assertEqual (line 92)

Will trigger a pass if the two parameters have the same value only. Otherwise a fail.

  • access: public
void assertEqual (mixed $first, mixed $second, [string $message = "%s"])
  • mixed $first: Value to compare.
  • mixed $second: Value to compare.
  • string $message: Message to display.
assertError (line 241)

Confirms that an error has occoured and optionally that the error text matches exactly.

  • access: public
void assertError ([string $expected = false], [string $message = "%s"])
  • string $expected: Expected error text or false for no check.
  • string $message: Message to display.
assertErrorPattern (line 263)

Confirms that an error has occoured and that the error text matches a Perl regular expression.

  • access: public
void assertErrorPattern (mixed $pattern, [string $message = "%s"], string $expected)
  • string $expected: Perl regular expresion to match against.
  • string $message: Message to display.
assertIdentical (line 122)

Will trigger a pass if the two parameters have the same value and same type. Otherwise a fail.

  • access: public
void assertIdentical (mixed $first, mixed $second, [string $message = "%s"])
  • mixed $first: Value to compare.
  • mixed $second: Value to compare.
  • string $message: Message to display.
assertIsA (line 77)

Type and class test. Will pass if class matches the type name or is a subclass or if not an object, but the type is correct.

  • access: public
void assertIsA (mixed $object, string $type, [string $message = "%s"])
  • mixed $object: Object to test.
  • string $type: Type name as string.
  • string $message: Message to display.
assertNoErrors (line 226)

Confirms that no errors have occoured so far in the test method.

  • access: public
void assertNoErrors ([string $message = "%s"])
  • string $message: Message to display.
assertNotEqual (line 107)

Will trigger a pass if the two parameters have a different value. Otherwise a fail.

  • access: public
void assertNotEqual (mixed $first, mixed $second, [string $message = "%s"])
  • mixed $first: Value to compare.
  • mixed $second: Value to compare.
  • string $message: Message to display.
assertNotIdentical (line 137)

Will trigger a pass if the two parameters have the different value or different type.

  • access: public
void assertNotIdentical (mixed $first, mixed $second, [string $message = "%s"])
  • mixed $first: Value to compare.
  • mixed $second: Value to compare.
  • string $message: Message to display.
assertNotNull (line 60)

Will be true if the value is set.

  • access: public
void assertNotNull (mixed $value, [string $message = "%s"])
  • mixed $value: Supposedly set value.
  • string $message: Message to display.
assertNoUnwantedPattern (line 213)

Will trigger a pass if the perl regex pattern is not present in subject. Fail if found.

  • access: public
void assertNoUnwantedPattern (string $pattern, string $subject, [string $message = "%s"])
  • string $pattern: Perl regex to look for including the regex delimiters.
  • string $subject: String to search in.
  • string $message: Message to display.
assertNull (line 46)

Will be true if the value is null.

  • access: public
void assertNull (null $value, [string $message = "%s"])
  • null $value: Supposedly null value.
  • string $message: Message to display.
assertReference (line 152)

Will trigger a pass if both parameters refer to the same object. Fail otherwise.

  • access: public
void assertReference (mixed &$first, mixed &$second, [string $message = "%s"])
  • mixed $first: Object reference to check.
  • mixed $second: Hopefully the same object.
  • string $message: Message to display.
assertWantedPattern (line 197)

Will trigger a pass if the Perl regex pattern is found in the subject. Fail otherwise.

  • access: public
void assertWantedPattern (string $pattern, string $subject, [string $message = "%s"])
  • string $pattern: Perl regex to look for including the regex delimiters.
  • string $subject: String to search in.
  • string $message: Message to display.

Inherited Methods

Inherited From SimpleTestCase

 SimpleTestCase::SimpleTestCase()
 SimpleTestCase::assertExpectation()
 SimpleTestCase::assertFalse()
 SimpleTestCase::assertTrue()
 SimpleTestCase::dump()
 SimpleTestCase::error()
 SimpleTestCase::fail()
 SimpleTestCase::getAssertionLine()
 SimpleTestCase::invoke()
 SimpleTestCase::pass()
 SimpleTestCase::run()
 SimpleTestCase::sendMessage()
 SimpleTestCase::setUp()
 SimpleTestCase::signal()
 SimpleTestCase::swallowErrors()
 SimpleTestCase::tearDown()
 SimpleTestCase::_createRunner()
 SimpleTestCase::_isConstructor()
 SimpleTestCase::_isTest()

Inherited From RunnableTest

 RunnableTest::RunnableTest()
 RunnableTest::getLabel()
 RunnableTest::getSize()
 RunnableTest::run()

Documentation generated on Fri, 10 Dec 2004 18:26:49 +0000 by phpDocumentor 1.3.0RC3