PHPUnit2
[ class tree: PHPUnit2 ] [ index: PHPUnit2 ] [ all elements ]

Class: PHPUnit2_Framework_Assert

Source Location: /PHPUnit2-2.3.6/Framework/Assert.php

Class Overview


A set of assert methods.


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 2002-2006 Sebastian Bergmann <sb@sebastian-bergmann.de>

Methods


Child classes:

PHPUnit2_Extensions_TestDecorator
A Decorator for Tests.
PHPUnit2_Framework_TestCase
A TestCase defines the fixture to run multiple tests.

Inherited Variables

Inherited Methods


Class Details

[line 65]
A set of assert methods.


[ Top ]


Method Detail

assertContains   [line 91]

void assertContains( mixed $needle, mixed $haystack, [string $message = ''])

Asserts that a haystack contains a needle.
  • Since: Method available since Release 2.1.0
  • Static: This method can be called statically
  • Access: public

Parameters:

mixed   $needle     
mixed   $haystack     
string   $message     

[ Top ]

assertEquals   [line 179]

void assertEquals( mixed $expected, mixed $actual, [string $message = ''], [mixed $delta = 0])

Asserts that two variables are equal.
  • Static: This method can be called statically
  • Access: public

Parameters:

mixed   $expected     
mixed   $actual     
string   $message     
mixed   $delta     

[ Top ]

assertFalse   [line 278]

void assertFalse( boolean $condition, [string $message = ''])

Asserts that a condition is false.
  • Static: This method can be called statically
  • Access: public
  • Throws: Exception

Parameters:

boolean   $condition     
string   $message     

[ Top ]

assertNotContains   [line 105]

void assertNotContains( mixed $needle, mixed $haystack, [string $message = ''])

Asserts that a haystack does not contain a needle.
  • Since: Method available since Release 2.1.0
  • Static: This method can be called statically
  • Access: public

Parameters:

mixed   $needle     
mixed   $haystack     
string   $message     

[ Top ]

assertNotEquals   [line 194]

void assertNotEquals( mixed $expected, mixed $actual, [string $message = ''], [mixed $delta = 0])

Asserts that two variables are not equal.
  • Since: Method available since Release 2.3.0
  • Static: This method can be called statically
  • Access: public

Parameters:

mixed   $expected     
mixed   $actual     
string   $message     
mixed   $delta     

[ Top ]

assertNotNull   [line 294]

void assertNotNull( mixed $actual, [string $message = ''])

Asserts that a variable is not NULL.
  • Static: This method can be called statically
  • Access: public

Parameters:

mixed   $actual     
string   $message     

[ Top ]

assertNotRegExp   [line 435]

void assertNotRegExp( string $pattern, string $string, [string $message = ''])

Asserts that a string does not match a given regular expression.
  • Since: Method available since Release 2.1.0
  • Static: This method can be called statically
  • Access: public

Parameters:

string   $pattern     
string   $string     
string   $message     

[ Top ]

assertNotSame   [line 342]

void assertNotSame( mixed $expected, mixed $actual, [string $message = ''])

Asserts that two variables do not have the same type and value.

Used on objects, it asserts that two variables do not reference the same object.

  • Static: This method can be called statically
  • Access: public

Parameters:

mixed   $expected     
mixed   $actual     
string   $message     

[ Top ]

assertNotType   [line 371]

void assertNotType( string $expected, mixed $actual, [string $message = ''])

Asserts that a variable is not of a given type.
  • Since: Method available since Release 2.2.0
  • Static: This method can be called statically
  • Access: public

Parameters:

string   $expected     
mixed   $actual     
string   $message     

[ Top ]

assertNull   [line 308]

void assertNull( mixed $actual, [string $message = ''])

Asserts that a variable is NULL.
  • Static: This method can be called statically
  • Access: public

Parameters:

mixed   $actual     
string   $message     

[ Top ]

assertRegExp   [line 421]

void assertRegExp( string $pattern, string $string, [string $message = ''])

Asserts that a string matches a given regular expression.
  • Static: This method can be called statically
  • Access: public

Parameters:

string   $pattern     
string   $string     
string   $message     

[ Top ]

assertSame   [line 325]

void assertSame( mixed $expected, mixed $actual, [string $message = ''])

Asserts that two variables have the same type and value.

Used on objects, it asserts that two variables reference the same object.

  • Static: This method can be called statically
  • Access: public

Parameters:

mixed   $expected     
mixed   $actual     
string   $message     

[ Top ]

assertTrue   [line 259]

void assertTrue( boolean $condition, [string $message = ''])

Asserts that a condition is true.
  • Static: This method can be called statically
  • Access: public
  • Throws: Exception

Parameters:

boolean   $condition     
string   $message     

[ Top ]

assertType   [line 357]

void assertType( string $expected, mixed $actual, [string $message = ''])

Asserts that a variable is of a given type.
  • Static: This method can be called statically
  • Access: public

Parameters:

string   $expected     
mixed   $actual     
string   $message     

[ Top ]

fail   [line 490]

void fail( [string $message = ''])

Fails a test with the given message.
  • Static: This method can be called statically
  • Access: public
  • Throws: PHPUnit2_Framework_AssertionFailedError

Parameters:

string   $message     

[ Top ]

format   [line 543]

void format( mixed $expected, mixed $actual, string $message)

  • Static: This method can be called statically
  • Access: public

Parameters:

mixed   $expected     
mixed   $actual     
string   $message     

[ Top ]

setLooselyTyped   [line 559]

void setLooselyTyped( boolean $looselyTyped)

  • Static: This method can be called statically
  • Access: public

Parameters:

boolean   $looselyTyped     

[ Top ]

__construct   [line 78]

void __construct( )

Protect constructor since it is a static only class.
  • Access: protected

Overridden in child classes as:

PHPUnit2_Extensions_TestDecorator::__construct()
Constructor.
PHPUnit2_Extensions_RepeatedTest::__construct()
Constructor.
PHPUnit2_Framework_TestCase::__construct()
Constructs a test case with the given name.
PHPUnit2_Framework_Warning::__construct()

[ Top ]


Documentation generated on Tue, 12 Sep 2006 09:34:59 -0400 by phpDocumentor 1.2.3. PEAR Logo Copyright © PHP Group 2004.