PHP 트레잇 FBMock_AssertionHelpers

파일 보기 프로젝트 열기: facebook/fbmock

공개 메소드들

메소드 설명
assertCalledOnce ( FBMock_Mock $mock, $method_name, $args = null, $msg = '' ) Assert that the method was called once. If $args is given, check that it matches the args $method_name was called with.
assertCalls ( FBMock_Mock $mock, $method_name ) Assert that the method calls match the array of calls.
assertNotCalled ( FBMock_Mock $mock, $method_name, $msg = '' ) Assert that the method was not called.
assertNumCalls ( FBMock_Mock $mock, $method_name, $expected_num_calls, $msg = '' ) Assert that the method was called a certain number of times on a mock

메소드 상세

assertCalledOnce() 공개 정적인 메소드

Assert that the method was called once. If $args is given, check that it matches the args $method_name was called with.
public static assertCalledOnce ( FBMock_Mock $mock, $method_name, $args = null, $msg = '' )
$mock FBMock_Mock a mock object
$method_name name of method to check
$args expected arguments (optional)
$msg message for assert (optional)

assertCalls() 공개 정적인 메소드

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') );
public static assertCalls ( FBMock_Mock $mock, $method_name )
$mock FBMock_Mock a mock object
$method_name name of method to check

assertNotCalled() 공개 정적인 메소드

Assert that the method was not called.
public static assertNotCalled ( FBMock_Mock $mock, $method_name, $msg = '' )
$mock FBMock_Mock a mock object
$method_name name of method to check
$msg message for assert (optional)

assertNumCalls() 공개 정적인 메소드

Assert that the method was called a certain number of times on a mock
public static assertNumCalls ( FBMock_Mock $mock, $method_name, $expected_num_calls, $msg = '' )
$mock FBMock_Mock a mock object
$method_name name of method to check
$expected_num_calls expected number of calls
$msg message for assert (optional)