@@ -68,4 +68,43 @@ public function getCurrentQueryStringBinding(): array
6868 $ this ->assertSame (['table ' => ['except ' => null , 'history ' => false , 'keep ' => false , 'as ' => 'table ' ]], $ testTableQueryString ->getCurrentQueryStringBinding ());
6969
7070 }
71+
72+ public function test_check_querystring_alias_returns_default_if_enabled (): void
73+ {
74+
75+ $ testTableQueryString = new class extends PetsTable
76+ {
77+ public function configure (): void
78+ {
79+ parent ::configure ();
80+ $ this ->setQueryStringEnabled ();
81+ }
82+
83+ public function getCurrentQueryStringBinding (): array
84+ {
85+ return $ this ->queryStringWithQueryString ();
86+ }
87+ };
88+
89+ $ testTableQueryString ->mountManagesFilters ();
90+ $ testTableQueryString ->configure ();
91+ $ testTableQueryString ->boot ();
92+ $ testTableQueryString ->bootedComponentUtilities ();
93+ $ testTableQueryString ->bootedManagesFilters ();
94+ $ testTableQueryString ->bootedWithColumns ();
95+ $ testTableQueryString ->bootedWithColumnSelect ();
96+ $ testTableQueryString ->bootedWithSecondaryHeader ();
97+ $ testTableQueryString ->booted ();
98+
99+ $ this ->assertFalse ($ testTableQueryString ->hasQueryStringAlias ());
100+ $ this ->assertSame ('table ' , $ testTableQueryString ->getQueryStringAlias ());
101+ $ this ->assertSame (['table ' => ['except ' => null , 'history ' => false , 'keep ' => false , 'as ' => 'table ' ]], $ testTableQueryString ->getCurrentQueryStringBinding ());
102+
103+ $ testTableQueryString ->setQueryStringAlias ('test123 ' );
104+
105+ $ this ->assertTrue ($ testTableQueryString ->hasQueryStringAlias ());
106+ $ this ->assertSame ('test123 ' , $ testTableQueryString ->getQueryStringAlias ());
107+ $ this ->assertSame (['table ' => ['except ' => null , 'history ' => false , 'keep ' => false , 'as ' => 'test123 ' ]], $ testTableQueryString ->getCurrentQueryStringBinding ());
108+
109+ }
71110}
0 commit comments