DumpTest.php 762 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. declare(strict_types=1);
  3. namespace Tests\Endpoints;
  4. use MeiliSearch\Exceptions\ApiException;
  5. use Tests\TestCase;
  6. final class DumpTest extends TestCase
  7. {
  8. public function testCreateDumpAndGetStatus(): void
  9. {
  10. $dump = $this->client->createDump();
  11. $this->assertArrayHasKey('uid', $dump);
  12. $this->assertArrayHasKey('status', $dump);
  13. $this->assertEquals('in_progress', $dump['status']);
  14. $dump = $this->client->getDumpStatus($dump['uid']);
  15. $this->assertArrayHasKey('uid', $dump);
  16. $this->assertArrayHasKey('status', $dump);
  17. }
  18. public function testDumpNotFound(): void
  19. {
  20. $this->expectException(ApiException::class);
  21. $this->client->getDumpStatus('not-found');
  22. }
  23. }