Skip to content
Merged
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
39 changes: 39 additions & 0 deletions tests/Unit/Traits/Helpers/QueryStringHelpersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,43 @@ public function getCurrentQueryStringBinding(): array
$this->assertSame(['table' => ['except' => null, 'history' => false, 'keep' => false, 'as' => 'table']], $testTableQueryString->getCurrentQueryStringBinding());

}

public function test_check_querystring_alias_returns_default_if_enabled(): void
{

$testTableQueryString = new class extends PetsTable
{
public function configure(): void
{
parent::configure();
$this->setQueryStringEnabled();
}

public function getCurrentQueryStringBinding(): array
{
return $this->queryStringWithQueryString();
}
};

$testTableQueryString->mountManagesFilters();
$testTableQueryString->configure();
$testTableQueryString->boot();
$testTableQueryString->bootedComponentUtilities();
$testTableQueryString->bootedManagesFilters();
$testTableQueryString->bootedWithColumns();
$testTableQueryString->bootedWithColumnSelect();
$testTableQueryString->bootedWithSecondaryHeader();
$testTableQueryString->booted();

$this->assertFalse($testTableQueryString->hasQueryStringAlias());
$this->assertSame('table', $testTableQueryString->getQueryStringAlias());
$this->assertSame(['table' => ['except' => null, 'history' => false, 'keep' => false, 'as' => 'table']], $testTableQueryString->getCurrentQueryStringBinding());

$testTableQueryString->setQueryStringAlias('test123');

$this->assertTrue($testTableQueryString->hasQueryStringAlias());
$this->assertSame('test123', $testTableQueryString->getQueryStringAlias());
$this->assertSame(['table' => ['except' => null, 'history' => false, 'keep' => false, 'as' => 'test123']], $testTableQueryString->getCurrentQueryStringBinding());

}
}
Loading