Inheritance: extends AbstractCommand
Ejemplo n.º 1
0
 public function it_returns_the_syntax_error_as_the_response_in_bad_commands($language, SlashCommand $command)
 {
     $command->offsetGet('text')->willReturn('foo + 2');
     $errorMessage = 'Variable "foo" is not valid around position 1.';
     $error = new SyntaxError('Variable "foo" is not valid', 1);
     $language->evaluate('foo + 2', [])->willThrow($error);
     $this->execute($command)['text']->shouldBe($errorMessage);
 }
Ejemplo n.º 2
0
 public function it_does_not_match_unmatched_names(SlashCommand $command)
 {
     $command->get('command')->willReturn('/bar');
     $this->setCommandName('/foo')->matches($command)->shouldReturn(false);
 }