Наследование: extends Crummy\Phlack\Common\Encodable, extends ArrayAccess, extends Guzzle\Common\ToArrayInterface
Пример #1
0
 public function it_replies_to_carol(CommandInterface $command)
 {
     $command->offsetGet('channel_id')->willReturn('C98765');
     $command->offsetGet('channel_name')->willReturn('group');
     $command->offsetGet('user_id')->willReturn('U12346');
     $command->offsetGet('user_name')->willReturn('carol');
     $this->reply($command, 'I got your message.')['text']->shouldReturn('<@U12346|carol> I got your message.');
 }
Пример #2
0
 public function it_sequences_a_command(CommandInterface $command)
 {
     $command->offsetGet('user_id')->willReturn('U8686');
     $command->offsetGet('user_name')->willReturn('agent');
     $command->offsetGet('channel_id')->willReturn('C0001');
     $command->offsetGet('channel_name')->willReturn('cone');
     $this->command($command)->shouldReturn(['channel' => '<#C0001|cone>', 'user' => '<@U8686|agent>']);
 }
Пример #3
0
 /**
  * @param CommandInterface $command
  *
  * @return bool
  */
 public function matches(CommandInterface $command)
 {
     return $this->getCommandName() === $command->get('command');
 }