feat: max-bot-test initial — full surface coverage
Some checks failed
Deploy Max Bot Test / deploy (push) Failing after 3s

- Slim 4 PSR-15 webhook, PHP-DI 7, Symfony Console 8
- 13 update handlers, 30+ command scenarios, all 7 button types
- Composer pulls pkirillw/max-bot-api-php from GitHub vcs
- Multi-stage Dockerfile (php-fpm 8.4-alpine) + nginx
- docker-compose.yml targets server (npm_default external)
- docker-compose.override.yml for local dev (gitignored)
- .gitea/workflows/deploy.yml mirrors ghost-blog-bot pattern

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
pkirillw
2026-06-18 00:01:06 +03:00
commit 9385fbdd6e
60 changed files with 7191 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
<?php
declare(strict_types=1);
namespace App\Tests\Unit;
use App\Util\ParsedCommand;
use PHPUnit\Framework\TestCase;
final class ParsedCommandTest extends TestCase
{
public function testParseSimpleCommand(): void
{
$cmd = ParsedCommand::parse('/help');
self::assertNotNull($cmd);
self::assertSame('help', $cmd->name);
self::assertSame([], $cmd->args);
self::assertSame('', $cmd->tail);
}
public function testParseCommandWithArgs(): void
{
$cmd = ParsedCommand::parse('/chat 123');
self::assertNotNull($cmd);
self::assertSame('chat', $cmd->name);
self::assertSame(['123'], $cmd->args);
self::assertSame('123', $cmd->tail);
self::assertSame(123, $cmd->argInt(0));
}
public function testParseColonSyntaxExtractsParam(): void
{
$cmd = ParsedCommand::parse('/bot_patch:NewName');
self::assertNotNull($cmd);
self::assertSame('bot_patch', $cmd->name);
self::assertSame(['NewName'], $cmd->args);
}
public function testParseReturnsNullForPlainText(): void
{
self::assertNull(ParsedCommand::parse('hello'));
self::assertNull(ParsedCommand::parse(''));
self::assertNull(ParsedCommand::parse(' '));
}
}