Inheritance: implements Zumba\Swivel\BehaviorInterface, use trait Psr\Log\LoggerAwareTrait
Esempio n. 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();
 }
Esempio n. 2
0
 /**
  * Set the behavior and it's args
  *
  * @param \Zumba\Swivel\Behavior $behavior
  * @param array $args
  * @return void
  */
 protected function setBehavior(Behavior $behavior, array $args = [])
 {
     $slug = $behavior->getSlug();
     $this->logger->debug('Swivel - Setting behavior.', compact('slug', 'args'));
     $this->behavior = $behavior;
     $this->args = $args;
 }