示例#1
0
 /**
  * Tests tring to invoke
  * @covers \Copycat\Callback\Handler::tryInvoke()
  */
 public function testTryInvoke()
 {
     $handler = new Handler(array('foo' => new Collection(array(function () {
         return 'bar';
     }))));
     $this->assertInternalType('array', $handler->tryInvoke('foo'));
     $result = $handler->tryInvoke('foo');
     $this->assertEquals('bar', $result[0]);
     $this->assertInternalType('array', $handler->tryInvoke('bar'));
     $this->assertEmpty($handler->tryInvoke('bar'));
 }