Skip to content

Commit

Permalink
Increase sleep time for test (#69)
Browse files Browse the repository at this point in the history
* Increase sleep time for test

* Update ScoutHasUuidsTest.php
  • Loading branch information
zingimmick authored Aug 31, 2023
1 parent d594865 commit e8febc3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions tests/ScoutHasUuidsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ public function testSearch(): void
SearchableModelHasUuids::query()->create([
'name' => 'not matched',
]);
sleep(1);
sleep(2);
$this->assertCount(6, SearchableModelHasUuids::search('test')->get());
SearchableModelHasUuids::query()->firstOrFail()->delete();
sleep(1);
sleep(2);
$this->assertCount(5, SearchableModelHasUuids::search('test')->get());
$this->assertCount(1, SearchableModelHasUuids::search('test')->paginate(2, 'page', 3)->items());
if (method_exists(Builder::class, 'cursor')) {
Expand All @@ -78,7 +78,7 @@ public function testSearch(): void

$this->assertCount(5, SearchableModelHasUuids::search('test')->keys());
SearchableModelHasUuids::removeAllFromSearch();
sleep(1);
sleep(2);
$this->assertCount(0, SearchableModelHasUuids::search('test')->get());
$this->assertCount(0, SearchableModelHasUuids::search('test')->paginate(2, 'page', 3)->items());
if (method_exists(Builder::class, 'cursor')) {
Expand All @@ -105,7 +105,7 @@ public function testWhere(): void
SearchableModelHasUuids::query()->create([
'name' => 'nothing',
]);
sleep(1);
sleep(2);
$this->assertCount(3, SearchableModelHasUuids::search('test')->get());
$this->assertCount(2, SearchableModelHasUuids::search('test')->where('is_visible', 1)->get());
if (method_exists(Builder::class, 'whereIn')) {
Expand Down
10 changes: 5 additions & 5 deletions tests/ScoutTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ public function testSearch(): void
SearchableModel::query()->create([
'name' => 'not matched',
]);
sleep(1);
sleep(2);
$this->assertCount(6, SearchableModel::search('test')->get());
SearchableModel::query()->firstOrFail()->delete();
sleep(1);
sleep(2);
$this->assertCount(5, SearchableModel::search('test')->get());
$this->assertCount(1, SearchableModel::search('test')->paginate(2, 'page', 3)->items());
if (method_exists(Builder::class, 'cursor')) {
Expand All @@ -67,7 +67,7 @@ public function testSearch(): void

$this->assertCount(5, SearchableModel::search('test')->keys());
SearchableModel::removeAllFromSearch();
sleep(1);
sleep(2);
$this->assertCount(0, SearchableModel::search('test')->get());
$this->assertCount(0, SearchableModel::search('test')->paginate(2, 'page', 3)->items());
if (method_exists(Builder::class, 'cursor')) {
Expand All @@ -88,7 +88,7 @@ public function testOrderBy(): void
SearchableModel::query()->create([
'name' => 'test search 3',
]);
sleep(1);
sleep(2);
$this->assertSame(3, SearchableModel::search('test')->orderBy('id', 'desc')->first()->getKey());
$this->assertSame(1, SearchableModel::search('test')->orderBy('id')->first()->getKey());
$this->assertSame(3, SearchableModel::search('test')->orderBy('id', 'desc')->first()->getKey());
Expand All @@ -111,7 +111,7 @@ public function testWhere(): void
SearchableModel::query()->create([
'name' => 'nothing',
]);
sleep(1);
sleep(2);
$this->assertCount(3, SearchableModel::search('test')->get());
$this->assertCount(2, SearchableModel::search('test')->where('is_visible', 1)->get());
if (method_exists(Builder::class, 'whereIn')) {
Expand Down

0 comments on commit e8febc3

Please sign in to comment.