mock_objects.php
public function expectMaximumCallCount($method, $count, $message = '%s')
    {
        $this->dieOnNoMethod($method, 'set maximum call count');
        $message .= Mock::getExpectationLine();
        $this->max_counts[strtolower($method)] =
                new MaximumCallCountExpectation($method, $count, $message);
    }
public function expectMaximumCallCount($method, $count, $message = '%s')
    {
        $this->dieOnNoMethod($method, 'set maximum call count');
        $message .= Mock::getExpectationLine();
        $this->max_counts[strtolower($method)] =
                new MaximumCallCountExpectation($method, $count, $message);
    }
public function expectMaximumCallCount ( $ method , $ count , $ message = '%s' ) { $ this -> dieOnNoMethod ( $ method , 'set maximum call count' ) ; $ message .= Mock :: getExpectationLine ( ) ; $ this -> max_counts [ strtolower ( $ method ) ] = new MaximumCallCountExpectation ( $ method , $ count , $ message ) ; }
Sets the number of times a method may be called before a test failure is triggered.

@param string $method        Method call to test.
@param int $count            Most number of times it should have been called.
@param string $message       Overridden message.
Sets the number of times a method may be called before a test failure is triggered .