Skip to content

Commit 7607957

Browse files
ondrejmirtesdg
authored andcommitted
tests: specify isLinkCurrent behavior for conflicting action and signal between destination string and args
1 parent cf23824 commit 7607957

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

tests/UI/PresenterComponent.isLinkCurrent().asserts.php

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,3 +171,55 @@ function callIsLinkCurrent(Application\Request $request, $destination, array $ar
171171
'otherSignal!',
172172
[]
173173
));
174+
175+
176+
// conflicting action in destination string and args
177+
Assert::false(callIsLinkCurrent(
178+
new Application\Request('Test', Http\Request::GET, [
179+
Application\UI\Presenter::ACTION_KEY => 'default',
180+
'int' => 1,
181+
'bool' => TRUE,
182+
]),
183+
'Test:default',
184+
[
185+
Application\UI\Presenter::ACTION_KEY => 'otherAction',
186+
]
187+
));
188+
189+
Assert::false(callIsLinkCurrent(
190+
new Application\Request('Test', Http\Request::GET, [
191+
Application\UI\Presenter::ACTION_KEY => 'default',
192+
'int' => 1,
193+
'bool' => TRUE,
194+
]),
195+
'Test:otherAction',
196+
[
197+
Application\UI\Presenter::ACTION_KEY => 'default',
198+
]
199+
));
200+
201+
202+
// conflicting signal in destination string and args
203+
Assert::false(callIsLinkCurrent(
204+
new Application\Request('Test', Http\Request::GET, [
205+
Application\UI\Presenter::SIGNAL_KEY => 'signal',
206+
'int' => 1,
207+
'bool' => TRUE,
208+
]),
209+
'signal!',
210+
[
211+
Application\UI\Presenter::SIGNAL_KEY => 'otherSignal',
212+
]
213+
));
214+
215+
Assert::false(callIsLinkCurrent(
216+
new Application\Request('Test', Http\Request::GET, [
217+
Application\UI\Presenter::SIGNAL_KEY => 'signal',
218+
'int' => 1,
219+
'bool' => TRUE,
220+
]),
221+
'otherSignal!',
222+
[
223+
Application\UI\Presenter::SIGNAL_KEY => 'signal',
224+
]
225+
));

0 commit comments

Comments
 (0)