@@ -37,16 +37,21 @@ protected function setUp()
37
37
/**
38
38
* App isolation is enabled to protect next tests from polluted registry by getUrl().
39
39
*
40
+ * @param string $routePath
40
41
* @param array $requestParams
41
42
* @param string $expectedResult
42
43
* @param array|null $routeParams
43
44
* @dataProvider getUrlDataProvider
44
45
* @magentoAppIsolation enabled
45
46
*/
46
- public function testGetUrl (array $ requestParams , string $ expectedResult , array $ routeParams = null )
47
- {
47
+ public function testGetUrl (
48
+ string $ routePath ,
49
+ array $ requestParams ,
50
+ string $ expectedResult ,
51
+ array $ routeParams = null
52
+ ) {
48
53
$ this ->request ->setParams ($ requestParams );
49
- $ url = $ this ->_model ->getUrl (' adminhtml/auth/login ' , $ routeParams );
54
+ $ url = $ this ->_model ->getUrl ($ routePath , $ routeParams );
50
55
$ this ->assertContains ($ expectedResult , $ url );
51
56
}
52
57
@@ -62,10 +67,12 @@ public function getUrlDataProvider()
62
67
63
68
return [
64
69
[
70
+ 'routePath ' => 'adminhtml/auth/login ' ,
65
71
'requestParams ' => [],
66
72
'expectedResult ' => 'admin/auth/login/key/ ' ,
67
73
],
68
74
[
75
+ 'routePath ' => 'adminhtml/auth/login ' ,
69
76
'requestParams ' => [],
70
77
'expectedResult ' => '/param1/a1==/ ' ,
71
78
'routeParams ' => [
@@ -74,6 +81,7 @@ public function getUrlDataProvider()
74
81
],
75
82
],
76
83
[
84
+ 'routePath ' => 'adminhtml/auth/login ' ,
77
85
'requestParams ' => [],
78
86
'expectedResult ' => '/param1/a1==/ ' ,
79
87
'routeParams ' => [
@@ -82,6 +90,7 @@ public function getUrlDataProvider()
82
90
],
83
91
],
84
92
[
93
+ 'routePath ' => 'adminhtml/auth/login ' ,
85
94
'requestParams ' => ['param2 ' => 'a2== ' ],
86
95
'expectedResult ' => '/param2/a2==/ ' ,
87
96
'routeParams ' => [
@@ -90,6 +99,7 @@ public function getUrlDataProvider()
90
99
],
91
100
],
92
101
[
102
+ 'routePath ' => 'adminhtml/auth/login ' ,
93
103
'requestParams ' => [],
94
104
'expectedResult ' => '/param3/ ' . $ escaper ->encodeUrlParam ('a3== ' ) . '/ ' ,
95
105
'routeParams ' => [
@@ -98,13 +108,19 @@ public function getUrlDataProvider()
98
108
],
99
109
],
100
110
[
111
+ 'routePath ' => 'adminhtml/auth/login ' ,
101
112
'requestParams ' => ['param4 ' => 'a4== ' ],
102
113
'expectedResult ' => '/param4/ ' . $ escaper ->encodeUrlParam ('a4== ' ) . '/ ' ,
103
114
'routeParams ' => [
104
115
'_current ' => true ,
105
116
'_escape_params ' => true ,
106
117
],
107
118
],
119
+ [
120
+ 'routePath ' => 'route/controller/action/id/100 ' ,
121
+ 'requestParams ' => [],
122
+ 'expectedResult ' => 'id/100 ' ,
123
+ ],
108
124
];
109
125
}
110
126
0 commit comments