33namespace Code16 \Sharp \Utils \Testing ;
44
55use Closure ;
6+ use Code16 \Sharp \Filters \GlobalFilters \GlobalFilters ;
67use Code16 \Sharp \Http \Context \SharpBreadcrumb ;
78use Code16 \Sharp \Utils \Entities \SharpEntityManager ;
89use Code16 \Sharp \Utils \Links \BreadcrumbBuilder ;
10+ use Illuminate \Support \Facades \URL ;
911
1012trait SharpAssertions
1113{
@@ -42,6 +44,8 @@ public function withSharpBreadcrumb(Closure $callback): self
4244
4345 public function deleteFromSharpShow (string $ entityClassNameOrKey , $ instanceId )
4446 {
47+ URL ::defaults (['filterKey ' => GlobalFilters::$ defaultKey ]);
48+
4549 $ entityKey = $ this ->resolveEntityKey ($ entityClassNameOrKey );
4650
4751 return $ this
@@ -59,6 +63,8 @@ public function deleteFromSharpShow(string $entityClassNameOrKey, $instanceId)
5963
6064 public function deleteFromSharpList (string $ entityClassNameOrKey , $ instanceId )
6165 {
66+ URL ::defaults (['filterKey ' => GlobalFilters::$ defaultKey ]);
67+
6268 $ entityKey = $ this ->resolveEntityKey ($ entityClassNameOrKey );
6369
6470 return $ this
@@ -73,6 +79,8 @@ public function deleteFromSharpList(string $entityClassNameOrKey, $instanceId)
7379
7480 public function getSharpForm (string $ entityClassNameOrKey , $ instanceId = null )
7581 {
82+ URL ::defaults (['filterKey ' => GlobalFilters::$ defaultKey ]);
83+
7684 $ entityKey = $ this ->resolveEntityKey ($ entityClassNameOrKey );
7785
7886 return $ this
@@ -100,6 +108,8 @@ public function getSharpForm(string $entityClassNameOrKey, $instanceId = null)
100108
101109 public function getSharpSingleForm (string $ entityClassNameOrKey )
102110 {
111+ URL ::defaults (['filterKey ' => GlobalFilters::$ defaultKey ]);
112+
103113 $ entityKey = $ this ->resolveEntityKey ($ entityClassNameOrKey );
104114
105115 return $ this
@@ -117,6 +127,8 @@ public function getSharpSingleForm(string $entityClassNameOrKey)
117127
118128 public function updateSharpForm (string $ entityClassNameOrKey , $ instanceId , array $ data )
119129 {
130+ URL ::defaults (['filterKey ' => GlobalFilters::$ defaultKey ]);
131+
120132 $ entityKey = $ this ->resolveEntityKey ($ entityClassNameOrKey );
121133
122134 return $ this
@@ -135,6 +147,8 @@ public function updateSharpForm(string $entityClassNameOrKey, $instanceId, array
135147
136148 public function updateSharpSingleForm (string $ entityClassNameOrKey , array $ data )
137149 {
150+ URL ::defaults (['filterKey ' => GlobalFilters::$ defaultKey ]);
151+
138152 $ entityKey = $ this ->resolveEntityKey ($ entityClassNameOrKey );
139153
140154 return $ this
@@ -152,6 +166,8 @@ public function updateSharpSingleForm(string $entityClassNameOrKey, array $data)
152166
153167 public function getSharpShow (string $ entityClassNameOrKey , $ instanceId )
154168 {
169+ URL ::defaults (['filterKey ' => GlobalFilters::$ defaultKey ]);
170+
155171 $ entityKey = $ this ->resolveEntityKey ($ entityClassNameOrKey );
156172
157173 return $ this
@@ -170,6 +186,8 @@ public function getSharpShow(string $entityClassNameOrKey, $instanceId)
170186
171187 public function storeSharpForm (string $ entityClassNameOrKey , array $ data )
172188 {
189+ URL ::defaults (['filterKey ' => GlobalFilters::$ defaultKey ]);
190+
173191 $ entityKey = $ this ->resolveEntityKey ($ entityClassNameOrKey );
174192
175193 return $ this
@@ -193,6 +211,8 @@ public function callSharpInstanceCommandFromList(
193211 array $ data = [],
194212 ?string $ commandStep = null
195213 ) {
214+ URL ::defaults (['filterKey ' => GlobalFilters::$ defaultKey ]);
215+
196216 $ entityKey = $ this ->resolveEntityKey ($ entityClassNameOrKey );
197217
198218 $ commandKey = class_exists ($ commandKeyOrClassName )
@@ -222,6 +242,8 @@ public function callSharpInstanceCommandFromShow(
222242 array $ data = [],
223243 ?string $ commandStep = null
224244 ) {
245+ URL ::defaults (['filterKey ' => GlobalFilters::$ defaultKey ]);
246+
225247 $ entityKey = $ this ->resolveEntityKey ($ entityClassNameOrKey );
226248
227249 $ commandKey = class_exists ($ commandKeyOrClassName )
@@ -250,6 +272,8 @@ public function callSharpEntityCommandFromList(
250272 array $ data = [],
251273 ?string $ commandStep = null
252274 ) {
275+ URL ::defaults (['filterKey ' => GlobalFilters::$ defaultKey ]);
276+
253277 $ entityKey = $ this ->resolveEntityKey ($ entityClassNameOrKey );
254278
255279 $ commandKey = class_exists ($ commandKeyOrClassName )
0 commit comments