Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[9.x] Fix missing variable in closure #694

Merged
merged 1 commit into from
Jan 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"require-dev": {
"meilisearch/meilisearch-php": "^0.19",
"mockery/mockery": "^1.0",
"php-http/guzzle7-adapter": "^1.0",
"orchestra/testbench": "^6.17|^7.0",
"phpunit/phpunit": "^9.3"
},
Expand Down
2 changes: 1 addition & 1 deletion src/ScoutServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function register()
$meilisearchClientClassName = class_exists(MeiliSearchClient::class)
? MeiliSearchClient::class
: \Meilisearch\Client::class;
$this->app->singleton($meilisearchClientClassName, function ($app) {
$this->app->singleton($meilisearchClientClassName, function ($app) use ($meilisearchClientClassName) {
$config = $app['config']->get('scout.meilisearch');

$meilisearchVersionClassName = class_exists(MeiliSearch::class)
Expand Down
25 changes: 25 additions & 0 deletions tests/Feature/MeilisearchEngineTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

namespace Laravel\Scout\Tests\Feature;

use Laravel\Scout\ScoutServiceProvider;
use MeiliSearch\Client;
use Orchestra\Testbench\TestCase;

class MeilisearchEngineTest extends TestCase
{
protected function getPackageProviders($app)
{
return [ScoutServiceProvider::class];
}

protected function defineEnvironment($app)
{
$app->make('config')->set('scout.driver', 'meilisearch');
}

public function test_the_meilisearch_client_can_be_initialized()
{
$this->assertInstanceOf(Client::class, app(Client::class));
}
}