AssertionHelpers.php
public static function assertCalls(
      FBMock_Mock $mock,
      $method_name
      /* array $expected_first_call, array $expected_second_call, $msg = ''*/) {

    FBMock_Utils::assertString($method_name);
    $args = func_get_args();
    $msg = '';
    if (is_string(end($args))) {
      $msg = array_pop($args);
    }

    $expected_calls = array_slice($args, 2);
    self::assertNumCalls($mock, $method_name, count($expected_calls), $msg);

    $actual_calls = $mock->mockGetCalls($method_name);
    foreach ($expected_calls as $i => $call) {
      PHPUnit\Framework\TestCase::assertEquals(
        $call,
        $actual_calls[$i],
        $msg ?: "Call $i for method $method_name did not match expected call"
      );
    }
  }
public static function assertCalls(
      FBMock_Mock $mock,
      $method_name
      /* array $expected_first_call, array $expected_second_call, $msg = ''*/) {

    FBMock_Utils::assertString($method_name);
    $args = func_get_args();
    $msg = '';
    if (is_string(end($args))) {
      $msg = array_pop($args);
    }

    $expected_calls = array_slice($args, 2);
    self::assertNumCalls($mock, $method_name, count($expected_calls), $msg);

    $actual_calls = $mock->mockGetCalls($method_name);
    foreach ($expected_calls as $i => $call) {
      PHPUnit\Framework\TestCase::assertEquals(
        $call,
        $actual_calls[$i],
        $msg ?: "Call $i for method $method_name did not match expected call"
      );
    }
  }
public static function assertCalls ( FBMock_Mock $ mock , $ method_name /* array $expected_first_call, array $expected_second_call, $msg = ''*/ ) { FBMock_Utils :: assertString ( $ method_name ) ; $ args = func_get_args ( ) ; $ msg = '' ; if ( is_string ( end ( $ args ) ) ) { $ msg = array_pop ( $ args ) ; } $ expected_calls = array_slice ( $ args , 2 ) ; self :: assertNumCalls ( $ mock , $ method_name , count ( $ expected_calls ) , $ msg ) ; $ actual_calls = $ mock -> mockGetCalls ( $ method_name ) ; foreach ( $ expected_calls as $ i => $ call ) { PHPUnit \ Framework \ TestCase :: assertEquals ( $ call , $ actual_calls [ $ i ] , $ msg ? : "Call $i for method $method_name did not match expected call" ) ; } }
Assert that the method calls match the array of calls.

Example usage:

// Code under test calls method
$mock->testMethod(1,2,3);
$mock->testMethod('a', 'b', 'c');

// Test asserts calls
self::assertCalls(
$mock,
'testMethod',
array(1,2,3),
array('a', 'b', 'c')
);

@param  $mock         a mock object
@param  $method_name  name of method to check
@param  ...           arrays of expected arguments for each call
@param  $msg          message for assert (optional)
Assert that the method calls match the array of calls .