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

Fix conference search error #494

Merged
merged 1 commit into from
Dec 8, 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
2 changes: 2 additions & 0 deletions app/Models/UuidBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ class UuidBase extends Eloquent
*/
public $incrementing = false;

protected $keyType = 'string';

/**
* Boot function from laravel.
*/
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<env name="QUEUE_CONNECTION" value="sync"/>
<env name="SESSION_DRIVER" value="array"/>
<env name="TELESCOPE_ENABLED" value="false"/>
<env name="SCOUT_DRIVER" value="database"/>
<env name="SCOUT_DRIVER" value="collection"/>
<env name="CAPTCHA_PUBLIC" value="6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI"/>
<env name="CAPTCHA_PRIVATE" value="6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe"/>
</php>
Expand Down
12 changes: 12 additions & 0 deletions tests/Feature/ConferenceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1215,4 +1215,16 @@ function checking_whether_a_conferences_is_rejected()
$this->assertFalse($conferenceA->isRejected());
$this->assertTrue($conferenceB->isRejected());
}

/** @test */
public function searching_conferences_by_name(): void
{
$conferenceA = Conference::factory()->create(['location' => 'Boston, MA']);
$conferenceB = Conference::factory()->create(['location' => 'New York, NY']);

$results = Conference::searchQuery('boston', fn ($query) => $query)->get();

$this->assertContains($conferenceA->id, $results->pluck('id'));
$this->assertNotContains($conferenceB->id, $results->pluck('id'));
}
}
Loading