getInvocations() 공개 메소드

Returns the recorded function calls and its arguments.
public getInvocations ( ) : Invocation[]
리턴 Invocation[] The recorded function arguments.
예제 #1
0
파일: SpyTest.php 프로젝트: OndraM/php-mock
 /**
  * Tests spying.
  *
  * @param array    $expected
  * @param string   $name
  * @param callable $invocations
  *
  * @test
  * @dataProvider provideTestGetInvocations
  */
 public function testGetInvocations(array $expected, $name, callable $invocations)
 {
     $spy = new Spy(__NAMESPACE__, $name);
     $spy->enable();
     call_user_func($invocations);
     $this->assertEquals($expected, $spy->getInvocations());
 }
예제 #2
0
 /**
  * Test the invocation of a none exception call.
  *
  * @test
  */
 public function testNoException()
 {
     eval("function testNoException() { }");
     $spy = new Spy(__NAMESPACE__, "testNoException");
     $spy->enable();
     testNoException();
     $invocation = $spy->getInvocations()[0];
     $this->assertFalse($invocation->isExceptionThrown());
     $this->assertNull($invocation->getException());
 }