This bundle provides a set of shortcuts to help during tests.
// TODO
A set of assertions is available thanks to the MeiliSearchBundleAssertionTrait during functional tests:
- IndexCreated | Allow to test the number of index created:
<?php
use PHPUnit\Framework\TestCase;
use MeiliSearchBundle\Test\MeiliSearchBundleAssertionTrait;
final class Test extends TestCase
{
use MeiliSearchBundleAssertionTrait;
public function testHomepage(): void
{
// ...
static::assertIndexCreatedCount(1);
}
}
- IndexRemoved | Allow to test the number of index removed:
<?php
use PHPUnit\Framework\TestCase;
use MeiliSearchBundle\Test\MeiliSearchBundleAssertionTrait;
final class Test extends TestCase
{
use MeiliSearchBundleAssertionTrait;
public function testHomepage(): void
{
// ...
static::assertIndexRemovedCount(1);
}
}
- Search | Allow to test the number of search performed:
<?php
use PHPUnit\Framework\TestCase;
use MeiliSearchBundle\Test\MeiliSearchBundleAssertionTrait;
final class Test extends TestCase
{
use MeiliSearchBundleAssertionTrait;
public function testHomepage(): void
{
// ...
static::assertSearchCount(1);
}
}