phpunit.framework
[ class tree: phpunit.framework ] [ index: phpunit.framework ] [ all elements ]

Class: PHPUnit_Tests_Framework_DoublePrecisionAssertTest

Source Location: /PHPUnit2-2.0.0beta1/Tests/Framework/DoublePrecisionAssertTest.php

Class Overview

PHPUnit_Framework_Assert
   |
   --PHPUnit_Framework_TestCase
      |
      --PHPUnit_Tests_Framework_DoublePrecisionAssertTest

A TestCase defines the fixture to run multiple tests.


Author(s):

Methods


Inherited Variables

Inherited Methods

Class: PHPUnit_Framework_TestCase

PHPUnit_Framework_TestCase::countTestCases()
Counts the number of test cases executed by run(TestResult result).
PHPUnit_Framework_TestCase::createResult()
Creates a default TestResult object.
PHPUnit_Framework_TestCase::getCodeCoverageInformation()
Returns the Code Coverage information provided by Xdebug.
PHPUnit_Framework_TestCase::getName()
Gets the name of a TestCase.
PHPUnit_Framework_TestCase::run()
Runs the test case and collects the results in a given TestResult object.
PHPUnit_Framework_TestCase::runBare()
Runs the bare test sequence.
PHPUnit_Framework_TestCase::runTest()
Override to run the test and assert its state.
PHPUnit_Framework_TestCase::setName()
Sets the name of a TestCase.
PHPUnit_Framework_TestCase::setUp()
Sets up the fixture, for example, open a network connection.
PHPUnit_Framework_TestCase::tearDown()
Tears down the fixture, for example, close a network connection.
PHPUnit_Framework_TestCase::toString()
Returns a string representation of the test case.
PHPUnit_Framework_TestCase::__construct()
Constructs a test case with the given name.

Class: PHPUnit_Framework_Assert

PHPUnit_Framework_Assert::assertEquals()
Asserts that two variables are equal.
PHPUnit_Framework_Assert::assertFalse()
Asserts that a condition is false.
PHPUnit_Framework_Assert::assertNotNull()
Asserts that an object isn't null.
PHPUnit_Framework_Assert::assertNotSame()
Asserts that two objects refer not to the same object.
PHPUnit_Framework_Assert::assertNull()
Asserts that an object is null.
PHPUnit_Framework_Assert::assertRegExp()
Asserts that a string matches a given regular expression.
PHPUnit_Framework_Assert::assertSame()
Asserts that two objects refer to the same object.
PHPUnit_Framework_Assert::assertTrue()
Asserts that a condition is true.
PHPUnit_Framework_Assert::assertType()
Asserts that a variable is of a given type.
PHPUnit_Framework_Assert::fail()
Fails a test with the given message.
PHPUnit_Framework_Assert::format()
PHPUnit_Framework_Assert::setLooselyTyped()
PHPUnit_Framework_Assert::__construct()
Protect constructor since it is a static only class.

Class Details

[line 20]
A TestCase defines the fixture to run multiple tests.

To define a TestCase

1) Implement a subclass of PHPUnit_Framework_TestCase. 2) Define instance variables that store the state of the fixture. 3) Initialize the fixture state by overriding setUp(). 4) Clean-up after a test by overriding tearDown().

Each test runs in its own fixture so there can be no side effects among test runs.

Here is an example:

class MathTest extends PHPUnit_Framework_TestCase { public $value1; public $value2;

public function __construct($name) { parent::__construct($name); }

public function setUp() { $this->value1 = 2; $this->value2 = 3; } }

For each test implement a method which interacts with the fixture. Verify the expected results with assertions specified by calling assert with a boolean.

public function testPass() { $this->assertTrue($this->value1 + $this->value2 == 5); }



[ Top ]


Method Detail

testAssertEqualsNaNFails   [line 21]

void testAssertEqualsNaNFails( )


[ Top ]

testAssertNaNEqualsFails   [line 24]

void testAssertNaNEqualsFails( )


[ Top ]

testAssertNaNEqualsNaNFails   [line 27]

void testAssertNaNEqualsNaNFails( )


[ Top ]

testAssertNegInfinityEqualsInfinity   [line 39]

void testAssertNegInfinityEqualsInfinity( )


[ Top ]

testAssertPosInfinityEqualsInfinity   [line 36]

void testAssertPosInfinityEqualsInfinity( )


[ Top ]

testAssertPosInfinityNotEquals   [line 33]

void testAssertPosInfinityNotEquals( )


[ Top ]

testAssertPosInfinityNotEqualsNegInfinity   [line 30]

void testAssertPosInfinityNotEqualsNegInfinity( )


[ Top ]


Documentation generated on Sat, 1 May 2004 03:38:39 +0200 by phpDocumentor 1.2.3. PEAR Logo Copyright © PHP Group 2004.