getInvocations() публичный Метод

Returns the recorded function calls and its arguments.
public getInvocations ( ) : Invocation[]
Результат Invocation[] The recorded function arguments.
Пример #1
0
 /**
  * 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());
 }