Exemplo n.º 1
0
 /**
  * Tests the default function.
  *
  * @test
  */
 public function testDefaultFunction()
 {
     eval("function testDefaultFunction() { return 123; }");
     $spy = new Spy(__NAMESPACE__, "testDefaultFunction");
     $spy->enable();
     $result = testDefaultFunction();
     $this->assertEquals(123, $result);
 }
Exemplo n.º 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());
 }