-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
587: Changes related to the next Meilisearch release (v1.5.0) r=brunoocasali a=meili-bot Related to this issue: meilisearch/integration-guides#290 This PR: - gathers the changes related to the next Meilisearch release (v1.5.0) so that this package is ready when the official release is out. - should pass the tests against the [latest pre-release of Meilisearch](https://github.com/meilisearch/meilisearch/releases). - might eventually contain test failures until the Meilisearch v1.5.0 is out.⚠️ This PR should NOT be merged until the next release of Meilisearch (v1.5.0) is out. _This PR is auto-generated for the [pre-release week](https://github.com/meilisearch/integration-guides/blob/main/resources/pre-release-week.md) purpose._ Co-authored-by: meili-bot <74670311+meili-bot@users.noreply.github.com> Co-authored-by: Bruno Casali <brunoocasali@gmail.com>
- Loading branch information
Showing
6 changed files
with
61 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Meilisearch\Endpoints\Delegates; | ||
|
||
use Meilisearch\Endpoints\Snapshots; | ||
|
||
trait HandlesSnapshots | ||
{ | ||
protected Snapshots $snapshots; | ||
|
||
public function createSnapshot(): array | ||
{ | ||
return $this->snapshots->create(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Meilisearch\Endpoints; | ||
|
||
use Meilisearch\Contracts\Endpoint; | ||
|
||
class Snapshots extends Endpoint | ||
{ | ||
protected const PATH = '/snapshots'; | ||
|
||
public function create(): array | ||
{ | ||
return $this->http->post(self::PATH); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Tests\Endpoints; | ||
|
||
use Tests\TestCase; | ||
|
||
final class SnapshotsTest extends TestCase | ||
{ | ||
public function testCreateSnapshots(): void | ||
{ | ||
$expectedKeys = ['taskUid', 'indexUid', 'status', 'type', 'enqueuedAt']; | ||
|
||
$task = $this->client->createSnapshot(); | ||
|
||
$this->assertSame($expectedKeys, array_keys($task)); | ||
$this->assertSame($task['type'], 'snapshotCreation'); | ||
} | ||
} |