File tree Expand file tree Collapse file tree 3 files changed +20
-24
lines changed Expand file tree Collapse file tree 3 files changed +20
-24
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ public function testGeocode(): void
47
47
{
48
48
$ this ->delegate ->expects ($ this ->once ())
49
49
->method ('geocodeQuery ' )
50
- ->will ( $ this -> returnValue ( new AddressCollection ([]) ));
50
+ ->willReturn ( new AddressCollection ([]));
51
51
52
52
$ this ->geocoder ->geocode ('foo ' );
53
53
@@ -74,7 +74,7 @@ public function testReverse(): void
74
74
{
75
75
$ this ->delegate ->expects ($ this ->once ())
76
76
->method ('reverseQuery ' )
77
- ->will ( $ this -> returnValue ( new AddressCollection ([]) ));
77
+ ->willReturn ( new AddressCollection ([]));
78
78
79
79
$ this ->geocoder ->reverse (0 , 0 );
80
80
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ public function testReverse(): void
53
53
$ result = new AddressCollection (['foo ' => 'bar ' ]);
54
54
$ mockTwo ->expects ($ this ->once ())
55
55
->method ('reverseQuery ' )
56
- ->will ( $ this -> returnValue ( $ result) );
56
+ ->willReturn ( $ result );
57
57
58
58
$ chain = new Chain ([$ mockOne , $ mockTwo ]);
59
59
@@ -75,7 +75,7 @@ public function testGeocode(): void
75
75
$ mockTwo ->expects ($ this ->once ())
76
76
->method ('geocodeQuery ' )
77
77
->with ($ query )
78
- ->will ( $ this -> returnValue ( $ result) );
78
+ ->willReturn ( $ result );
79
79
80
80
$ chain = new Chain ([$ mockOne , $ mockTwo ]);
81
81
Original file line number Diff line number Diff line change @@ -86,9 +86,7 @@ public function testIpAddressIsPassedCorrectToReader(string $geoIp2Model): void
86
86
->expects ($ this ->once ())
87
87
->method ($ geoIp2Model )
88
88
->with ('127.0.0.1 ' )
89
- ->will ($ this ->returnValue (
90
- $ this ->getGeoIP2ModelMock ($ geoIp2Model )
91
- ));
89
+ ->willReturn ($ this ->getGeoIP2ModelMock ($ geoIp2Model ));
92
90
93
91
$ adapter = new GeoIP2Adapter ($ geoIp2Provider , $ geoIp2Model );
94
92
$ adapter ->getContent ('file://geoip?127.0.0.1 ' );
@@ -110,7 +108,7 @@ public function testReaderResponseIsJsonEncoded(): void
110
108
$ geoIp2Provider
111
109
->expects ($ this ->any ())
112
110
->method ('city ' )
113
- ->will ( $ this -> returnValue ( $ cityModel) );
111
+ ->willReturn ( $ cityModel );
114
112
115
113
$ adapter = new GeoIP2Adapter ($ geoIp2Provider );
116
114
@@ -145,23 +143,21 @@ protected function getGeoIP2ModelMock($geoIP2Model)
145
143
$ mock
146
144
->expects ($ this ->any ())
147
145
->method ('jsonSerialize ' )
148
- ->will ($ this ->returnValue (
149
- [
150
- 'city ' => [
151
- 'geoname_id ' => 2911298 ,
152
- 'names ' => [
153
- 'de ' => 'Hamburg ' ,
154
- 'en ' => 'Hamburg ' ,
155
- 'es ' => 'Hamburgo ' ,
156
- 'fr ' => 'Hambourg ' ,
157
- 'ja ' => 'ハンブルク ' ,
158
- 'pt-BR ' => 'Hamburgo ' ,
159
- 'ru ' => 'Гамбург ' ,
160
- 'zh-CN ' => '汉堡市 ' ,
161
- ],
146
+ ->willReturn ([
147
+ 'city ' => [
148
+ 'geoname_id ' => 2911298 ,
149
+ 'names ' => [
150
+ 'de ' => 'Hamburg ' ,
151
+ 'en ' => 'Hamburg ' ,
152
+ 'es ' => 'Hamburgo ' ,
153
+ 'fr ' => 'Hambourg ' ,
154
+ 'ja ' => 'ハンブルク ' ,
155
+ 'pt-BR ' => 'Hamburgo ' ,
156
+ 'ru ' => 'Гамбург ' ,
157
+ 'zh-CN ' => '汉堡市 ' ,
162
158
],
163
- ]
164
- ) );
159
+ ],
160
+ ] );
165
161
166
162
return $ mock ;
167
163
}
You can’t perform that action at this time.
0 commit comments