Skip to content
This repository was archived by the owner on Nov 4, 2021. It is now read-only.

Commit 4f0f336

Browse files
committed
Fixed the migrate command tests.
1 parent 8e478ca commit 4f0f336

File tree

1 file changed

+4
-19
lines changed

1 file changed

+4
-19
lines changed

tests/ConsoleCommandsTest.php

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@
22

33
namespace ScoutElastic\Tests;
44

5-
use Illuminate\Support\Facades\Artisan;
65
use Mockery;
76
use ScoutElastic\Console\ElasticIndexCreateCommand;
87
use ScoutElastic\Console\ElasticIndexDropCommand;
98
use ScoutElastic\Console\ElasticIndexUpdateCommand;
109
use ScoutElastic\Console\ElasticMigrateCommand;
1110
use ScoutElastic\Console\ElasticUpdateMappingCommand;
12-
use ScoutElastic\ElasticEngine;
1311
use ScoutElastic\Tests\Stubs\IndexConfiguratorStub;
1412
use ScoutElastic\Tests\Stubs\ModelStub;
1513

@@ -19,8 +17,11 @@ private function fireCommand($class, array $arguments)
1917
{
2018
$command = Mockery::mock($class)
2119
->makePartial()
20+
2221
->shouldReceive('line')
23-
->andReturnNull()
22+
->getMock()
23+
24+
->shouldReceive('call')
2425
->getMock();
2526

2627
foreach ($arguments as $key => $value) {
@@ -217,14 +218,6 @@ public function test_if_the_update_mapping_command_builds_correct_response()
217218

218219
public function test_if_the_migrate_command_builds_correct_payload_for_new_target_index()
219220
{
220-
Mockery::mock('alias:' . Artisan::class)
221-
->makePartial()
222-
->shouldReceive('call')
223-
->with(
224-
'scout:import',
225-
['model' => ModelStub::class]
226-
);
227-
228221
$this->mockClient()
229222

230223
->shouldReceive('indices')
@@ -356,14 +349,6 @@ public function test_if_the_migrate_command_builds_correct_payload_for_new_targe
356349

357350
public function test_if_the_migrate_command_builds_correct_payload_for_existing_target_index()
358351
{
359-
Mockery::mock('alias:' . Artisan::class)
360-
->makePartial()
361-
->shouldReceive('call')
362-
->with(
363-
'scout:import',
364-
['model' => ModelStub::class]
365-
);
366-
367352
$this->mockClient()
368353

369354
->shouldReceive('indices')

0 commit comments

Comments
 (0)