Skip to content
This repository has been archived by the owner on May 13, 2021. It is now read-only.

Commit

Permalink
Update meilisearch/meilisearch-php to v0.17.0 (#107)
Browse files Browse the repository at this point in the history
* Update meilisearch/meilisearch-php requirement || ^0.17

Updates the requirements on meilisearch/meilisearch-php to permit the latest version.

Signed-off-by: dependabot-preview[bot] <[email protected]>

* Rename HTTPRequestException into ApiException

* Only use meilisearch-php v0.17 in composer.json

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Clémentine Urquizar <[email protected]>
  • Loading branch information
dependabot-preview[bot] and curquiza authored Mar 10, 2021
1 parent 78cc665 commit e180d66
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"require": {
"php": "^7.2|^8.0",
"laravel/scout": "^8.0",
"meilisearch/meilisearch-php": "^0.16",
"meilisearch/meilisearch-php": "^0.17",
"http-interop/http-factory-guzzle": "^1.0"
},
"require-dev": {
Expand Down
4 changes: 2 additions & 2 deletions src/Console/IndexMeilisearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Illuminate\Console\Command;
use MeiliSearch\Client;
use MeiliSearch\Exceptions\HTTPRequestException;
use MeiliSearch\Exceptions\ApiException;

class IndexMeilisearch extends Command
{
Expand Down Expand Up @@ -51,7 +51,7 @@ public function handle(Client $client)
$creation_options
);
$this->info('Index "'.$this->argument('name').'" created.');
} catch (HTTPRequestException $exception) {
} catch (ApiException $exception) {
$this->error($exception->getMessage());
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Engines/MeilisearchEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function __construct(Meilisearch $meilisearch, bool $softDelete = false)
*
* @return void
*
* @throws \MeiliSearch\Exceptions\HTTPRequestException
* @throws \MeiliSearch\Exceptions\ApiException
*/
public function update($models)
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Feature/MeilisearchConsoleCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Meilisearch\Scout\Tests\Feature;

use MeiliSearch\Client;
use MeiliSearch\Exceptions\HTTPRequestException;
use MeiliSearch\Exceptions\ApiException;

class MeilisearchConsoleCommandTest extends FeatureTestCase
{
Expand Down Expand Up @@ -43,7 +43,7 @@ public function indexCanBeCreatedAndDeleted()
try {
resolve(Client::class)->index($indexUid)->fetchRawInfo();
$this->fail('Exception should be thrown that index doesn\'t exist!');
} catch (HTTPRequestException $exception) {
} catch (ApiException $exception) {
$this->assertTrue(true);
}
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/MeilisearchConsoleCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Laravel\Scout\EngineManager;
use MeiliSearch\Client;
use MeiliSearch\Endpoints\Indexes;
use MeiliSearch\Exceptions\HTTPRequestException;
use MeiliSearch\Exceptions\ApiException;
use Meilisearch\Scout\Engines\MeilisearchEngine;
use Meilisearch\Scout\Tests\TestCase;
use Mockery as m;
Expand Down Expand Up @@ -78,7 +78,7 @@ public function deleteParameterDeletesIndex()
public function commandReturnsErrorStatusCodeOnException()
{
$client = $this->mock(Client::class);
$client->expects('createIndex')->andThrow(new HTTPRequestException(404, ['message' => 'Testmessage']));
$client->expects('createIndex')->andThrow(new ApiException(404, ['message' => 'Testmessage']));

$engineManager = $this->mock(EngineManager::class);
$engineManager->shouldReceive('engine')->with('meilisearch')->andReturn(new MeilisearchEngine($client));
Expand Down

0 comments on commit e180d66

Please sign in to comment.