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

Class: PHPUnit2_Framework_Assert

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

Class Overview


A set of assert methods.


Author(s):

Copyright:

  • Copyright &copy; 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 32]
A set of assert methods.


[ Top ]


Method Detail

__construct (Constructor)   [line 50]

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_PerformanceTestCase::__construct()
PHPUnit2_Extensions_ExceptionTestCase::__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: 2.1.0
  • Access: public

Parameters:

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

[ Top ]

assertEquals   [line 99]

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 179]

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

Asserts that a condition is false.
  • Access: public

Parameters:

boolean   $condition   — 
string   $message   — 

[ Top ]

assertNotContains   [line 82]

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

Asserts that a haystack does not contain a needle.
  • Since: 2.1.0
  • Access: public

Parameters:

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

[ Top ]

assertNotNull   [line 199]

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

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

Parameters:

mixed   $actual   — 
string   $message   — 

[ Top ]

assertNotRegExp   [line 330]

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

Asserts that a string does not match a given regular expression.
  • Since: 2.1.0
  • Access: public

Parameters:

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

[ Top ]

assertNotSame   [line 257]

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

Asserts that two variables do not reference the same object.
  • Access: public

Parameters:

object   $object   — 
string   $message   — 
   $expected   — 
   $actual   — 

[ Top ]

assertNotType   [line 297]

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

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

Parameters:

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

[ Top ]

assertNull   [line 216]

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

Asserts that a variable is NULL.
  • Access: public

Parameters:

mixed   $actual   — 
string   $message   — 

[ Top ]

assertRegExp   [line 313]

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 234]

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

Asserts that two variables reference the same object.
  • Access: public

Parameters:

object   $object   — 
string   $message   — 
   $expected   — 
   $actual   — 

[ Top ]

assertTrue   [line 158]

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

Asserts that a condition is true.
  • Access: public

Parameters:

boolean   $condition   — 
string   $message   — 

[ Top ]

assertType   [line 280]

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 345]

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

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

Parameters:

string   $message   — 

[ Top ]

format   [line 359]

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

  • Access: public

Parameters:

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

[ Top ]

setLooselyTyped   [line 378]

void setLooselyTyped( boolean $looselyTyped)

  • Access: public

Parameters:

boolean   $looselyTyped   — 

[ Top ]


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