@@ 247-267 (lines=21) @@ | ||
244 | $this->assertSame($page, $this->parameterResolver->resolveCurrentPage()); |
|
245 | } |
|
246 | ||
247 | public function testResolveCurrentPageExplicitParameter() |
|
248 | { |
|
249 | $this->requestStack |
|
250 | ->expects($this->exactly(2)) |
|
251 | ->method('getMasterRequest') |
|
252 | ->will($this->returnValue($request = $this->createRequestMock())); |
|
253 | ||
254 | $request->attributes |
|
255 | ->expects($this->once()) |
|
256 | ->method('get') |
|
257 | ->with($this->identicalTo('_lug_page_parameter'), $this->identicalTo('page')) |
|
258 | ->will($this->returnValue($pageParameter = 'p')); |
|
259 | ||
260 | $request |
|
261 | ->expects($this->once()) |
|
262 | ->method('get') |
|
263 | ->with($this->identicalTo($pageParameter), $this->identicalTo($page = 1)) |
|
264 | ->will($this->returnValue($page)); |
|
265 | ||
266 | $this->assertSame($page, $this->parameterResolver->resolveCurrentPage()); |
|
267 | } |
|
268 | ||
269 | public function testResolveCurrentPageExplicitPage() |
|
270 | { |
|
@@ 269-289 (lines=21) @@ | ||
266 | $this->assertSame($page, $this->parameterResolver->resolveCurrentPage()); |
|
267 | } |
|
268 | ||
269 | public function testResolveCurrentPageExplicitPage() |
|
270 | { |
|
271 | $this->requestStack |
|
272 | ->expects($this->exactly(2)) |
|
273 | ->method('getMasterRequest') |
|
274 | ->will($this->returnValue($request = $this->createRequestMock())); |
|
275 | ||
276 | $request->attributes |
|
277 | ->expects($this->once()) |
|
278 | ->method('get') |
|
279 | ->with($this->identicalTo('_lug_page_parameter'), $this->identicalTo($pageParameter = 'page')) |
|
280 | ->will($this->returnValue($pageParameter)); |
|
281 | ||
282 | $request |
|
283 | ->expects($this->once()) |
|
284 | ->method('get') |
|
285 | ->with($this->identicalTo($pageParameter), $this->identicalTo(1)) |
|
286 | ->will($this->returnValue($page = 2)); |
|
287 | ||
288 | $this->assertSame($page, $this->parameterResolver->resolveCurrentPage()); |
|
289 | } |
|
290 | ||
291 | public function testResolveFormWithoutRequest() |
|
292 | { |
|
@@ 990-1010 (lines=21) @@ | ||
987 | $this->assertSame('forms', $this->parameterResolver->resolveTranslationDomain()); |
|
988 | } |
|
989 | ||
990 | public function testResolveTranslationDomainDefault() |
|
991 | { |
|
992 | $this->requestStack |
|
993 | ->expects($this->exactly(2)) |
|
994 | ->method('getMasterRequest') |
|
995 | ->will($this->returnValue($request = $this->createRequestMock())); |
|
996 | ||
997 | $request->attributes |
|
998 | ->expects($this->at(0)) |
|
999 | ->method('get') |
|
1000 | ->with($this->identicalTo('_lug_grid'), $this->isNull()) |
|
1001 | ->will($this->returnValue(null)); |
|
1002 | ||
1003 | $request->attributes |
|
1004 | ->expects($this->at(1)) |
|
1005 | ->method('get') |
|
1006 | ->with($this->identicalTo('_lug_translation_domain'), $this->identicalTo($translationDomain = 'forms')) |
|
1007 | ->will($this->returnValue($translationDomain)); |
|
1008 | ||
1009 | $this->assertSame($translationDomain, $this->parameterResolver->resolveTranslationDomain()); |
|
1010 | } |
|
1011 | ||
1012 | public function testResolveTranslationDomainExplicit() |
|
1013 | { |
|
@@ 1012-1032 (lines=21) @@ | ||
1009 | $this->assertSame($translationDomain, $this->parameterResolver->resolveTranslationDomain()); |
|
1010 | } |
|
1011 | ||
1012 | public function testResolveTranslationDomainExplicit() |
|
1013 | { |
|
1014 | $this->requestStack |
|
1015 | ->expects($this->exactly(2)) |
|
1016 | ->method('getMasterRequest') |
|
1017 | ->will($this->returnValue($request = $this->createRequestMock())); |
|
1018 | ||
1019 | $request->attributes |
|
1020 | ->expects($this->at(0)) |
|
1021 | ->method('get') |
|
1022 | ->with($this->identicalTo('_lug_grid'), $this->isNull()) |
|
1023 | ->will($this->returnValue(null)); |
|
1024 | ||
1025 | $request->attributes |
|
1026 | ->expects($this->at(1)) |
|
1027 | ->method('get') |
|
1028 | ->with($this->identicalTo('_lug_translation_domain'), $this->identicalTo('forms')) |
|
1029 | ->will($this->returnValue($translationDomain = 'translation_domain')); |
|
1030 | ||
1031 | $this->assertSame($translationDomain, $this->parameterResolver->resolveTranslationDomain()); |
|
1032 | } |
|
1033 | ||
1034 | public function testResolveTranslationDomainWithGrid() |
|
1035 | { |
|
@@ 1034-1054 (lines=21) @@ | ||
1031 | $this->assertSame($translationDomain, $this->parameterResolver->resolveTranslationDomain()); |
|
1032 | } |
|
1033 | ||
1034 | public function testResolveTranslationDomainWithGrid() |
|
1035 | { |
|
1036 | $this->requestStack |
|
1037 | ->expects($this->exactly(2)) |
|
1038 | ->method('getMasterRequest') |
|
1039 | ->will($this->returnValue($request = $this->createRequestMock())); |
|
1040 | ||
1041 | $request->attributes |
|
1042 | ->expects($this->at(0)) |
|
1043 | ->method('get') |
|
1044 | ->with($this->identicalTo('_lug_grid'), $this->isNull()) |
|
1045 | ->will($this->returnValue(['grid'])); |
|
1046 | ||
1047 | $request->attributes |
|
1048 | ->expects($this->at(1)) |
|
1049 | ->method('get') |
|
1050 | ->with($this->identicalTo('_lug_translation_domain'), $this->identicalTo($translationDomain = 'grids')) |
|
1051 | ->will($this->returnValue($translationDomain)); |
|
1052 | ||
1053 | $this->assertSame($translationDomain, $this->parameterResolver->resolveTranslationDomain()); |
|
1054 | } |
|
1055 | ||
1056 | public function testResolveTranslationDomainExplicitWithGrid() |
|
1057 | { |
|
@@ 1056-1076 (lines=21) @@ | ||
1053 | $this->assertSame($translationDomain, $this->parameterResolver->resolveTranslationDomain()); |
|
1054 | } |
|
1055 | ||
1056 | public function testResolveTranslationDomainExplicitWithGrid() |
|
1057 | { |
|
1058 | $this->requestStack |
|
1059 | ->expects($this->exactly(2)) |
|
1060 | ->method('getMasterRequest') |
|
1061 | ->will($this->returnValue($request = $this->createRequestMock())); |
|
1062 | ||
1063 | $request->attributes |
|
1064 | ->expects($this->at(0)) |
|
1065 | ->method('get') |
|
1066 | ->with($this->identicalTo('_lug_grid'), $this->isNull()) |
|
1067 | ->will($this->returnValue(['grid'])); |
|
1068 | ||
1069 | $request->attributes |
|
1070 | ->expects($this->at(1)) |
|
1071 | ->method('get') |
|
1072 | ->with($this->identicalTo('_lug_translation_domain'), $this->identicalTo('grids')) |
|
1073 | ->will($this->returnValue($translationDomain = 'translation_domain')); |
|
1074 | ||
1075 | $this->assertSame($translationDomain, $this->parameterResolver->resolveTranslationDomain()); |
|
1076 | } |
|
1077 | ||
1078 | public function testResolveValidationGroupsWithoutRequest() |
|
1079 | { |