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)

SimpleTestCase
   |
   --UnitTestCase
Direct descendents
Class Description
 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 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 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 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 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 TestOfAbsoluteUrls Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfFrameUrl 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 TestOfBrowserFrames 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 TestOfForm 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 TestOfStickyError 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 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 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 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 TestOfFieldExpectation Standard unit test class for day to day testing of PHP code XP style. Adds some useful standard assertions.
 class TestOfHeaderExpectations 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 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 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 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 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 Maintenance_TestOfStatisticsAdServer A class for testing the Maintenance_Statistics_AdServer class.
 class Maintenance_TestOfStatistics A class for testing the Maintenance_Statistics class.
 class Maintenance_TestOfStatisticsCommon A class for testing the Maintenance_Statistics_Common 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_TestOfStatisticsTracker A class for testing the Maintenance_Statistics_Tracker 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_TestOfDal A class for testing the Dal class.
 class Dal_TestOfStatisticsTracker A class for testing the Dal_Statistics_Tracker class.
 class Dal_TestOfStatisticsAdServerSplit A class for testing the Dal_Statistics_AdServerSplit class.
 class Dal_TestOfStatisticsTrackerSplit A class for testing the Dal_Statistics_AdServerSplit class.
 class Delivery_TestOfGeoIP A class for testing the geoipGetInfo function. Will only test all database types if the databases are available - contact MaxMind LLC (http://maxmind.com/).
 class Delivery_TestOfMod_GeoIP A class for testing the mod_geoipGetInfo function.
 class Delivery_TestOfLib_Log A class for testing the lib-log.inc.php functions.
Method Summary
 UnitTestCase UnitTestCase ([string $label = false])
 boolean assertCopy (mixed &$first, mixed &$second, [string $message = "%s"])
 boolean assertEqual (mixed $first, mixed $second, [string $message = "%s"])
 boolean assertError ([string $expected = false], [string $message = "%s"])
 boolean assertErrorPattern (mixed $pattern, [string $message = "%s"], string $expected)
 boolean assertIdentical (mixed $first, mixed $second, [string $message = "%s"])
 boolean assertIsA (mixed $object, string $type, [string $message = "%s"])
 boolean assertNoErrors ([string $message = "%s"])
 boolean assertNotA (mixed $object, string $type, [string $message = "%s"])
 boolean assertNotEqual (mixed $first, mixed $second, [string $message = "%s"])
 boolean assertNotIdentical (mixed $first, mixed $second, [string $message = "%s"])
 boolean assertNotNull (mixed $value, [string $message = "%s"])
 boolean assertNoUnwantedPattern (string $pattern, string $subject, [string $message = "%s"])
 boolean assertNull (null $value, [string $message = "%s"])
 boolean assertReference (mixed &$first, mixed &$second, [string $message = "%s"])
 boolean assertWantedPattern (string $pattern, string $subject, [string $message = "%s"])
Variables
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 200)

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

  • return: True on pass
  • access: public
boolean 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 113)

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

  • return: True on pass
  • access: public
boolean 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 271)

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

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

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

  • return: True on pass
  • access: public
boolean assertErrorPattern (mixed $pattern, [string $message = "%s"], string $expected)
  • string $expected: Perl regular expresion to match against.
  • string $message: Message to display.
assertIdentical (line 145)

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

  • return: True on pass
  • access: public
boolean 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 80)

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.

  • return: True on pass.
  • access: public
boolean 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 255)

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

  • return: True on pass
  • access: public
boolean assertNoErrors ([string $message = "%s"])
  • string $message: Message to display.
assertNotA (line 97)

Type and class mismatch test. Will pass if class name or underling type does not match the one specified.

  • return: True on pass.
  • access: public
boolean assertNotA (mixed $object, string $type, [string $message = "%s"])
  • mixed $object: Object to test.
  • string $type: Type name as string.
  • string $message: Message to display.
assertNotEqual (line 129)

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

  • return: True on pass
  • access: public
boolean 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 161)

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

  • return: True on pass
  • access: public
boolean 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 62)

Will be true if the value is set.

  • return: True on pass.
  • access: public
boolean assertNotNull (mixed $value, [string $message = "%s"])
  • mixed $value: Supposedly set value.
  • string $message: Message to display.
assertNoUnwantedPattern (line 241)

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

  • return: True on pass
  • access: public
boolean 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 47)

Will be true if the value is null.

  • return: True on pass
  • access: public
boolean assertNull (null $value, [string $message = "%s"])
  • null $value: Supposedly null value.
  • string $message: Message to display.
assertReference (line 177)

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

  • return: True on pass
  • access: public
boolean 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 224)

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

  • return: True on pass
  • access: public
boolean 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::after()
 SimpleTestCase::assertExpectation()
 SimpleTestCase::assertFalse()
 SimpleTestCase::assertTrue()
 SimpleTestCase::before()
 SimpleTestCase::dump()
 SimpleTestCase::error()
 SimpleTestCase::fail()
 SimpleTestCase::getAssertionLine()
 SimpleTestCase::getLabel()
 SimpleTestCase::getSize()
 SimpleTestCase::pass()
 SimpleTestCase::run()
 SimpleTestCase::sendMessage()
 SimpleTestCase::setUp()
 SimpleTestCase::signal()
 SimpleTestCase::swallowErrors()
 SimpleTestCase::tearDown()
 SimpleTestCase::_createRunner()

Documentation generated on Fri, 11 Feb 2005 18:14:27 +0000 by phpDocumentor 1.3.0RC3