1111use Code16 \Sharp \Utils \Testing \Commands \PendingCommand ;
1212use Code16 \Sharp \Utils \Testing \Form \PendingForm ;
1313use Code16 \Sharp \Utils \Testing \IsPendingComponent ;
14+ use Code16 \Sharp \Utils \Testing \SharpAssertions ;
1415use Code16 \Sharp \Utils \Testing \Show \PendingShow ;
1516use Illuminate \Foundation \Testing \TestCase ;
1617use PHPUnit \Framework \Assert as PHPUnit ;
@@ -25,7 +26,7 @@ class PendingEntityList
2526 protected array $ filterValues = [];
2627
2728 public function __construct (
28- /** @var TestCase $test */
29+ /** @var TestCase&SharpAssertions $test */
2930 protected object $ test ,
3031 string $ entityKey ,
3132 public ?PendingShow $ parent = null ,
@@ -50,16 +51,17 @@ public function sharpForm(string $entityClassNameOrKey, string|int $instanceId):
5051
5152 public function withFilter (string $ filterKey , mixed $ value ): static
5253 {
53- $ key = $ this ->entityList ->filterContainer ()->findFilterHandler ($ filterKey )->getKey ();
54- $ this ->filterValues [$ key ] = $ value ;
54+ $ filter = $ this ->entityList ->filterContainer ()->findFilterHandler ($ filterKey );
55+
56+ PHPUnit::assertNotNull ($ filter , sprintf ('Unknown entity list filter [%s] ' , $ filterKey ));
57+
58+ $ this ->filterValues [$ filter ->getKey ()] = $ value ;
5559
5660 return $ this ;
5761 }
5862
5963 public function get (): AssertableEntityList
6064 {
61- $ this ->setGlobalFilterUrlDefault ();
62-
6365 return new AssertableEntityList (
6466 $ this ->parent instanceof PendingShow
6567 ? $ this ->test
@@ -85,8 +87,6 @@ public function get(): AssertableEntityList
8587
8688 public function entityCommand (string $ commandKeyOrClassName ): PendingCommand
8789 {
88- $ this ->setGlobalFilterUrlDefault ();
89-
9090 $ commandKey = class_exists ($ commandKeyOrClassName )
9191 ? class_basename ($ commandKeyOrClassName )
9292 : $ commandKeyOrClassName ;
@@ -134,8 +134,6 @@ public function entityCommand(string $commandKeyOrClassName): PendingCommand
134134
135135 public function instanceCommand (string $ commandKeyOrClassName , int |string $ instanceId ): PendingCommand
136136 {
137- $ this ->setGlobalFilterUrlDefault ();
138-
139137 $ commandKey = class_exists ($ commandKeyOrClassName )
140138 ? class_basename ($ commandKeyOrClassName )
141139 : $ commandKeyOrClassName ;
0 commit comments