Skip to content

Commit cf23824

Browse files
ondrejmirtesdg
authored andcommitted
tests: isLinkCurrent tests must run presenter with all required parameters
1 parent fa3ba64 commit cf23824

File tree

1 file changed

+28
-22
lines changed

1 file changed

+28
-22
lines changed

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

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,13 @@ function callIsLinkCurrent(Application\Request $request, $destination, array $ar
2828
}
2929

3030
Assert::true(callIsLinkCurrent(
31-
new Application\Request('Test', Http\Request::GET, []),
32-
'Test:default',
33-
[]
34-
));
35-
36-
Assert::true(callIsLinkCurrent(
37-
new Application\Request('Test', Http\Request::GET, ['int' => 1]),
31+
new Application\Request('Test', Http\Request::GET, ['int' => 1, 'bool' => TRUE]),
3832
'Test:default',
3933
[]
4034
));
4135

4236
Assert::false(callIsLinkCurrent(
43-
new Application\Request('Test', Http\Request::GET, ['int' => 1]),
37+
new Application\Request('Test', Http\Request::GET, ['int' => 1, 'bool' => TRUE]),
4438
'Test:default',
4539
['int' => 2]
4640
));
@@ -57,12 +51,6 @@ function callIsLinkCurrent(Application\Request $request, $destination, array $ar
5751
[]
5852
));
5953

60-
Assert::true(callIsLinkCurrent(
61-
new Application\Request('Test', Http\Request::GET, ['int' => 1, 'bool' => TRUE]),
62-
'Test:default',
63-
[]
64-
));
65-
6654
Assert::true(callIsLinkCurrent(
6755
new Application\Request('Test', Http\Request::GET, ['int' => 1, 'bool' => TRUE]),
6856
'Test:default',
@@ -115,21 +103,27 @@ function callIsLinkCurrent(Application\Request $request, $destination, array $ar
115103
));
116104

117105
Assert::true(callIsLinkCurrent(
118-
new Application\Request('Test', Http\Request::GET, []),
106+
new Application\Request('Test', Http\Request::GET, ['int' => 1, 'bool' => TRUE]),
119107
'Test:*',
120108
[]
121109
));
122110

111+
Assert::false(callIsLinkCurrent(
112+
new Application\Request('Test', Http\Request::GET, ['int' => 1, 'bool' => TRUE]),
113+
'Test:*',
114+
['float' => 1.0]
115+
));
116+
123117
Assert::true(callIsLinkCurrent(
124-
new Application\Request('Test', Http\Request::GET, ['int' => 1]),
118+
new Application\Request('Test', Http\Request::GET, ['int' => 1, 'bool' => TRUE, 'float' => 1.0]),
125119
'Test:*',
126-
[]
120+
['float' => 1.0]
127121
));
128122

129123
Assert::false(callIsLinkCurrent(
130-
new Application\Request('Test', Http\Request::GET),
124+
new Application\Request('Test', Http\Request::GET, ['int' => 1, 'bool' => TRUE, 'float' => 1.0]),
131125
'Test:*',
132-
['int' => 1]
126+
['float' => 2.0]
133127
));
134128

135129
Assert::true(callIsLinkCurrent(
@@ -149,19 +143,31 @@ function callIsLinkCurrent(Application\Request $request, $destination, array $ar
149143
));
150144

151145
Assert::true(callIsLinkCurrent(
152-
new Application\Request('Test', Http\Request::GET, [Application\UI\Presenter::SIGNAL_KEY => 'signal']),
146+
new Application\Request('Test', Http\Request::GET, [
147+
Application\UI\Presenter::SIGNAL_KEY => 'signal',
148+
'int' => 1,
149+
'bool' => TRUE,
150+
]),
153151
'Test:default',
154152
[]
155153
));
156154

157155
Assert::true(callIsLinkCurrent(
158-
new Application\Request('Test', Http\Request::GET, [Application\UI\Presenter::SIGNAL_KEY => 'signal']),
156+
new Application\Request('Test', Http\Request::GET, [
157+
Application\UI\Presenter::SIGNAL_KEY => 'signal',
158+
'int' => 1,
159+
'bool' => TRUE,
160+
]),
159161
'signal!',
160162
[]
161163
));
162164

163165
Assert::false(callIsLinkCurrent(
164-
new Application\Request('Test', Http\Request::GET, [Application\UI\Presenter::SIGNAL_KEY => 'signal']),
166+
new Application\Request('Test', Http\Request::GET, [
167+
Application\UI\Presenter::SIGNAL_KEY => 'signal',
168+
'int' => 1,
169+
'bool' => TRUE,
170+
]),
165171
'otherSignal!',
166172
[]
167173
));

0 commit comments

Comments
 (0)