From f8c82da808e0ff5ef1f0ffd56f0df04d6dd78c5b Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Sun, 27 Oct 2024 01:52:02 +0100 Subject: [PATCH] Adjust QueryString Search Tests --- .../QueryStrings/QueryStringForSearchTest.php | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/Traits/Core/QueryStrings/QueryStringForSearchTest.php b/tests/Traits/Core/QueryStrings/QueryStringForSearchTest.php index 91d693d58..818888e9b 100644 --- a/tests/Traits/Core/QueryStrings/QueryStringForSearchTest.php +++ b/tests/Traits/Core/QueryStrings/QueryStringForSearchTest.php @@ -84,6 +84,28 @@ public function configure(): void $mock->boot(); $this->assertSame('table-search', $mock->getQueryStringAliasForSearch()); + $this->assertFalse($mock->hasQueryStringAliasForSearch()); + } + + public function test_can_change_default_search_query_string_alias(): void + { + $mock = new class extends PetsTable + { + public ?array $testAttributesArray; + + public function configure(): void + { + $this->setDataTableFingerprint('test'); + } + }; + + $mock->configure(); + $mock->boot(); + + $this->assertSame('table-search', $mock->getQueryStringAliasForSearch()); + $mock->setQueryStringAliasForSearch('pet-search'); + $this->assertSame('pet-search', $mock->getQueryStringAliasForSearch()); $this->assertTrue($mock->hasQueryStringAliasForSearch()); } + }