@@ -17,19 +17,15 @@ public function setUp()
17
17
$ this ->objectManager = new ObjectManager ($ this );
18
18
}
19
19
/**
20
- * @param bool $isSecure
21
20
* @param string $uri
22
21
* @param string|null $vary
23
22
* @return \Magento\Framework\App\Request\Http
24
23
*/
25
- protected function getRequestMock ($ isSecure , $ uri , $ vary = null )
24
+ protected function getRequestMock ($ uri , $ vary = null )
26
25
{
27
26
$ requestMock = $ this ->getMock ('\Magento\Framework\App\Request\Http ' , [], [], '' , false );
28
27
$ requestMock ->expects ($ this ->once ())
29
- ->method ('isSecure ' )
30
- ->willReturn ($ isSecure );
31
- $ requestMock ->expects ($ this ->once ())
32
- ->method ('getRequestUri ' )
28
+ ->method ('getUriString ' )
33
29
->willReturn ($ uri );
34
30
$ requestMock ->expects ($ this ->once ())
35
31
->method ('get ' )
@@ -51,16 +47,15 @@ protected function getContextMock($getVeryStringCalledTimes, $vary)
51
47
return $ contextMock ;
52
48
}
53
49
/**
54
- * @param bool $isSecure
55
50
* @param string $uri
56
51
* @param string|null $varyStringCookie
57
52
* @param string|null $varyStringContext
58
53
* @param string $expected
59
- * @dataProvider dataProvider
54
+ * @dataProvider getValueDataProvider
60
55
*/
61
- public function testGetValue ($ isSecure , $ uri , $ varyStringCookie , $ varyStringContext , $ expected )
56
+ public function testGetValue ($ uri , $ varyStringCookie , $ varyStringContext , $ expected )
62
57
{
63
- $ request = $ this ->getRequestMock ($ isSecure , $ uri , $ varyStringCookie );
58
+ $ request = $ this ->getRequestMock ($ uri , $ varyStringCookie );
64
59
$ context = $ this ->getContextMock ($ varyStringCookie ? 0 : 1 , $ varyStringContext );
65
60
$ model = $ this ->objectManager ->getObject (
66
61
'\Magento\Framework\App\PageCache\Identifier ' ,
@@ -74,17 +69,16 @@ public function testGetValue($isSecure, $uri, $varyStringCookie, $varyStringCont
74
69
/**
75
70
* @return array
76
71
*/
77
- public function dataProvider ()
72
+ public function getValueDataProvider ()
78
73
{
79
- $ uri = 'index.php/customer ' ;
80
- $ isSecure = 0 ;
74
+ $ uri = 'http://domain.com/customer ' ;
81
75
$ vary = 1 ;
82
- $ data = [$ isSecure , $ uri , $ vary ];
76
+ $ data = [$ uri , $ vary ];
83
77
ksort ($ data );
84
78
$ expected = md5 (serialize ($ data ));
85
79
return [
86
- [$ isSecure , $ uri , $ vary , null , $ expected ],
87
- [$ isSecure , $ uri , null , $ vary , $ expected ]
80
+ [$ uri , $ vary , null , $ expected ],
81
+ [$ uri , null , $ vary , $ expected ]
88
82
];
89
83
}
90
84
}
0 commit comments