Class CallCountExpectation

Description

Confirms that the number of calls on a method is as expected.

Located in /mock_objects.php (line 156)

SimpleExpectation
   |
   --CallCountExpectation
Method Summary
 CallCountExpectation __construct (string $method, integer $count, [string $message = '%s'])
 boolean test (integer $compare)
 string testMessage (integer $compare)
Variables

Inherited Variables

Inherited from SimpleExpectation

SimpleExpectation::$dumper
Methods
Constructor __construct (line 167)

Stashes the method and expected count for later reporting.

CallCountExpectation __construct (string $method, integer $count, [string $message = '%s'])
  • string $method: Name of method to confirm against.
  • integer $count: Expected number of calls.
  • string $message: Custom error message.

Redefinition of:
SimpleExpectation::__construct()
Creates a dumper for displaying values and sets the test message.
test (line 178)

Tests the assertion. True if correct.

  • return: True if expected.
boolean test (integer $compare)
  • integer $compare: Measured call count.

Redefinition of:
SimpleExpectation::test()
Tests the expectation. True if correct.
testMessage (line 187)

Reports the comparison.

  • return: Message to show.
string testMessage (integer $compare)
  • integer $compare: Measured call count.

Redefinition of:
SimpleExpectation::testMessage()
Returns a human readable test message.

Inherited Methods

Inherited From SimpleExpectation

 SimpleExpectation::__construct()
 SimpleExpectation::getDumper()
 SimpleExpectation::isExpectation()
 SimpleExpectation::overlayMessage()
 SimpleExpectation::test()
 SimpleExpectation::testMessage()

Documentation generated on Sun, 31 Oct 2010 16:31:48 -0500 by phpDocumentor 1.4.3