Skip to content

Commit

Permalink
test with empty valued queue timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
hkulekci committed Feb 12, 2023
1 parent 0f41046 commit e32007f
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion tests/Feature/ImportCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ public function test_chained_queue_timeout_configuration(): void
});
}

public function test_chained_queue_timeout_configuration_with_empty_string(): void
public function test_chained_queue_timeout_configuration_with_null_value(): void
{
Bus::fake([
Import::class,
Expand All @@ -246,4 +246,26 @@ public function test_chained_queue_timeout_configuration_with_empty_string(): vo
return $job->timeout === null;
});
}

public function test_chained_queue_timeout_configuration_with_empty_string(): void
{
Bus::fake([
Import::class,
]);

$this->app['config']->set('scout.queue', ['connection' => 'sync', 'queue' => 'scout']);
$this->app['config']->set('elasticsearch.queue.timeout', '');

$output = new BufferedOutput();
Artisan::call('scout:import', [], $output);

$output = array_map('trim', explode("\n", $output->fetch()));

$this->assertContains(trans('scout::import.start', ['searchable' => Product::class]), $output);
$this->assertContains('[OK] '.trans('scout::import.done.queue', ['searchable' => Product::class]), $output);

Bus::assertDispatched(function (Import $job) {
return $job->timeout === null;
});
}
}

0 comments on commit e32007f

Please sign in to comment.