Return a fake command object for the passed command text
public static getFakeUpdateCommandObject ( string $command_text ) : |
||
$command_text | string | |
return |
public function testEchoCommandExecuteWithParameter() { $text = $this->command->setUpdate(TestHelpers::getFakeUpdateCommandObject('/echo Message!'))->execute()->getResult()->getText(); $this->assertEquals('Message!', $text); }
public function testHelpCommandExecuteWithParameterValidCommand() { $text = $this->command->setUpdate(TestHelpers::getFakeUpdateCommandObject('/help echo'))->execute()->getResult()->getText(); $this->assertContains("Description: Show text\nUsage: /echo <text>", $text); }