Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4814045

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

1 file changed

Lines changed: 52 additions & 0 deletions

File tree

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
array()
173173
));
174+
175+
176+
// conflicting action in destination string and args
177+
Assert::false(callIsLinkCurrent(
178+
new Application\Request('Test', Http\Request::GET, array(
179+
Application\UI\Presenter::ACTION_KEY => 'default',
180+
'int' => 1,
181+
'bool' => TRUE,
182+
)),
183+
'Test:default',
184+
array(
185+
Application\UI\Presenter::ACTION_KEY => 'otherAction',
186+
)
187+
));
188+
189+
Assert::false(callIsLinkCurrent(
190+
new Application\Request('Test', Http\Request::GET, array(
191+
Application\UI\Presenter::ACTION_KEY => 'default',
192+
'int' => 1,
193+
'bool' => TRUE,
194+
)),
195+
'Test:otherAction',
196+
array(
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, array(
205+
Application\UI\Presenter::SIGNAL_KEY => 'signal',
206+
'int' => 1,
207+
'bool' => TRUE,
208+
)),
209+
'signal!',
210+
array(
211+
Application\UI\Presenter::SIGNAL_KEY => 'otherSignal',
212+
)
213+
));
214+
215+
Assert::false(callIsLinkCurrent(
216+
new Application\Request('Test', Http\Request::GET, array(
217+
Application\UI\Presenter::SIGNAL_KEY => 'signal',
218+
'int' => 1,
219+
'bool' => TRUE,
220+
)),
221+
'otherSignal!',
222+
array(
223+
Application\UI\Presenter::SIGNAL_KEY => 'signal',
224+
)
225+
));

0 commit comments

Comments
 (0)