execute() public method

Execute the behavior's callable and return the result.
See also: Zumba\Swivel\BehaviorInterface
public execute ( array $args = [] ) : mixed
$args array
return mixed
Example #1
0
 public function testExecuteWithLogger()
 {
     $logger = $this->getMock('Psr\\Log\\NullLogger');
     $behavior = new Behavior('a', function () {
     });
     $behavior->setLogger($logger);
     $logger->expects($this->once())->method('debug')->with($this->isType('string'), $this->logicalAnd($this->arrayHasKey('slug'), $this->arrayHasKey('args')));
     $behavior->execute();
 }