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

Class: PHPUnit2_Framework_Assert

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

Class Overview


A set of assert methods.


Author(s):

Version:

  • Release: @package_version@

Copyright:

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

Methods


Child classes:

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

Inherited Variables

Inherited Methods


Class Details

[line 39]
A set of assert methods.


[ Top ]


Method Detail

__construct (Constructor)   [line 52]

PHPUnit2_Framework_Assert __construct( )

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

Overridden in child classes as:

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

[ Top ]

assertContains   [line 65]

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

Asserts that a haystack contains a needle.
  • Since: Method available since Release 2.1.0
  • Access: public

Parameters:

mixed   $needle   — 
mixed   $haystack   — 
string   $message   — 

[ Top ]

assertEquals   [line 153]

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

Asserts that two variables are equal.
  • Access: public

Parameters:

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

[ Top ]

assertFalse   [line 252]

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

Asserts that a condition is false.
  • Throws: Exception
  • Access: public

Parameters:

boolean   $condition   — 
string   $message   — 

[ Top ]

assertNotContains   [line 79]

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
  • Access: public

Parameters:

mixed   $needle   — 
mixed   $haystack   — 
string   $message   — 

[ Top ]

assertNotEquals   [line 168]

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
  • Access: public

Parameters:

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

[ Top ]

assertNotNull   [line 268]

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

Asserts that a variable is not NULL.
  • Access: public

Parameters:

mixed   $actual   — 
string   $message   — 

[ Top ]

assertNotRegExp   [line 409]

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
  • Access: public

Parameters:

string   $pattern   — 
string   $string   — 
string   $message   — 

[ Top ]

assertNotSame   [line 316]

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.

  • Access: public

Parameters:

mixed   $expected   — 
mixed   $actual   — 
string   $message   — 

[ Top ]

assertNotType   [line 345]

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
  • Access: public

Parameters:

string   $expected   — 
mixed   $actual   — 
string   $message   — 

[ Top ]

assertNull   [line 282]

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

Asserts that a variable is NULL.
  • Access: public

Parameters:

mixed   $actual   — 
string   $message   — 

[ Top ]

assertRegExp   [line 395]

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

Asserts that a string matches a given regular expression.
  • Access: public

Parameters:

string   $pattern   — 
string   $string   — 
string   $message   — 

[ Top ]

assertSame   [line 299]

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.

  • Access: public

Parameters:

mixed   $expected   — 
mixed   $actual   — 
string   $message   — 

[ Top ]

assertTrue   [line 233]

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

Asserts that a condition is true.
  • Throws: Exception
  • Access: public

Parameters:

boolean   $condition   — 
string   $message   — 

[ Top ]

assertType   [line 331]

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

Asserts that a variable is of a given type.
  • Access: public

Parameters:

string   $expected   — 
mixed   $actual   — 
string   $message   — 

[ Top ]

fail   [line 464]

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

Fails a test with the given message.
  • Throws: PHPUnit2_Framework_AssertionFailedError
  • Access: public

Parameters:

string   $message   — 

[ Top ]

format   [line 517]

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

  • Access: public

Parameters:

mixed   $expected   — 
mixed   $actual   — 
string   $message   — 

[ Top ]

setLooselyTyped   [line 533]

void setLooselyTyped( boolean $looselyTyped)

  • Access: public

Parameters:

boolean   $looselyTyped   — 

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:12:36 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.