FBMock_Utils::assertInt PHP Method

assertInt() public static method

public static assertInt ( $int )
    public static function assertInt($int)
    {
        if (!is_int($int)) {
            throw new InvalidArgumentException("Integer argument expected, " . gettype($int) . " given");
        }
    }

Usage Example

Beispiel #1
0
 /**
  * Assert that the method was called a certain number of times on a mock
  *
  * @param  $mock                a mock object
  * @param  $method_name         name of method to check
  * @param  $expected_num_calls  expected number of calls
  * @param  $msg                 message for assert (optional)
  */
 public static function assertNumCalls(FBMock_Mock $mock, $method_name, $expected_num_calls, $msg = '')
 {
     FBMock_Utils::assertString($method_name);
     FBMock_Utils::assertInt($expected_num_calls);
     $call_count = count($mock->mockGetCalls($method_name));
     PHPUnit_Framework_TestCase::assertEquals($expected_num_calls, $call_count, $msg ?: "{$method_name} called wrong number of times");
 }
All Usage Examples Of FBMock_Utils::assertInt