Add PHPUnit tests with coverage for all src classes
- 21 test files covering controllers, services, entities, enums, messages - CI: add test job with Xdebug coverage (clover + text) - SonarQube: configure coverage report path and test sources Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
25
tests/Message/MeilisearchMessageTest.php
Normal file
25
tests/Message/MeilisearchMessageTest.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Tests\Message;
|
||||
|
||||
use App\Message\MeilisearchMessage;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class MeilisearchMessageTest extends TestCase
|
||||
{
|
||||
public function testConstructorSetsProperties(): void
|
||||
{
|
||||
$message = new MeilisearchMessage('addDocuments', 'events', ['documents' => [['id' => 1]]]);
|
||||
|
||||
self::assertSame('addDocuments', $message->action);
|
||||
self::assertSame('events', $message->index);
|
||||
self::assertSame(['documents' => [['id' => 1]]], $message->payload);
|
||||
}
|
||||
|
||||
public function testDefaultPayloadIsEmpty(): void
|
||||
{
|
||||
$message = new MeilisearchMessage('deleteIndex', 'events');
|
||||
|
||||
self::assertSame([], $message->payload);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user