Example #1
0
 /**
  * Tests invoking
  * @covers Copycat\Callback\Handler::invoke()
  */
 public function testInvoke()
 {
     $handler = new Collection(array(function () {
         return 'bar';
     }, function ($test = null) {
         return $test;
     }));
     $this->assertInternalType('array', $handler->invoke());
     $result = $handler->invoke();
     $this->assertEquals('bar', $result[0]);
     $result = $handler->invoke(array('foo'));
     $this->assertEquals('foo', $result[1]);
 }