@@ -20,7 +20,9 @@ public function shouldPassGETRequestToClient()
2020 ->method ('get ' )
2121 ->with ('/path?param1=param1value ' , array ('header1 ' => 'header1value ' ))
2222 ->will ($ this ->returnValue ($ this ->getPSR7Response ($ expectedArray )));
23- $ client = $ this ->getMock ('Github\Client ' , array ('getHttpClient ' ));
23+ $ client = $ this ->getMockBuilder ('Github\Client ' )
24+ ->setMethods (array ('getHttpClient ' ))
25+ ->getMock ();
2426 $ client ->expects ($ this ->any ())
2527 ->method ('getHttpClient ' )
2628 ->willReturn ($ httpClient );
@@ -44,7 +46,9 @@ public function shouldPassPOSTRequestToClient()
4446 ->with ('/path ' , array ('option1 ' => 'option1value ' ), json_encode (array ('param1 ' => 'param1value ' )))
4547 ->will ($ this ->returnValue ($ this ->getPSR7Response ($ expectedArray )));
4648
47- $ client = $ this ->getMock ('Github\Client ' , array ('getHttpClient ' ));
49+ $ client = $ this ->getMockBuilder ('Github\Client ' )
50+ ->setMethods (array ('getHttpClient ' ))
51+ ->getMock ();
4852 $ client ->expects ($ this ->any ())
4953 ->method ('getHttpClient ' )
5054 ->willReturn ($ httpClient );
@@ -68,7 +72,9 @@ public function shouldPassPATCHRequestToClient()
6872 ->with ('/path ' , array ('option1 ' => 'option1value ' ), json_encode (array ('param1 ' => 'param1value ' )))
6973 ->will ($ this ->returnValue ($ this ->getPSR7Response ($ expectedArray )));
7074
71- $ client = $ this ->getMock ('Github\Client ' , array ('getHttpClient ' ));
75+ $ client = $ this ->getMockBuilder ('Github\Client ' )
76+ ->setMethods (array ('getHttpClient ' ))
77+ ->getMock ();
7278 $ client ->expects ($ this ->any ())
7379 ->method ('getHttpClient ' )
7480 ->willReturn ($ httpClient );
@@ -92,7 +98,9 @@ public function shouldPassPUTRequestToClient()
9298 ->with ('/path ' , array ('option1 ' => 'option1value ' ), json_encode (array ('param1 ' => 'param1value ' )))
9399 ->will ($ this ->returnValue ($ this ->getPSR7Response ($ expectedArray )));
94100
95- $ client = $ this ->getMock ('Github\Client ' , array ('getHttpClient ' ));
101+ $ client = $ this ->getMockBuilder ('Github\Client ' )
102+ ->setMethods (array ('getHttpClient ' ))
103+ ->getMock ();
96104 $ client ->expects ($ this ->any ())
97105 ->method ('getHttpClient ' )
98106 ->willReturn ($ httpClient );
@@ -116,7 +124,9 @@ public function shouldPassDELETERequestToClient()
116124 ->with ('/path ' , array ('option1 ' => 'option1value ' ), json_encode (array ('param1 ' => 'param1value ' )))
117125 ->will ($ this ->returnValue ($ this ->getPSR7Response ($ expectedArray )));
118126
119- $ client = $ this ->getMock ('Github\Client ' , array ('getHttpClient ' ));
127+ $ client = $ this ->getMockBuilder ('Github\Client ' )
128+ ->setMethods (array ('getHttpClient ' ))
129+ ->getMock ();
120130 $ client ->expects ($ this ->any ())
121131 ->method ('getHttpClient ' )
122132 ->willReturn ($ httpClient );
@@ -141,7 +151,9 @@ public function shouldNotPassEmptyRefToClient()
141151 ->with ('/path ' , array ())
142152 ->will ($ this ->returnValue ($ this ->getPSR7Response ($ expectedArray )));
143153
144- $ client = $ this ->getMock ('Github\Client ' , array ('getHttpClient ' ));
154+ $ client = $ this ->getMockBuilder ('Github\Client ' )
155+ ->setMethods (array ('getHttpClient ' ))
156+ ->getMock ();
145157 $ client ->expects ($ this ->any ())
146158 ->method ('getHttpClient ' )
147159 ->willReturn ($ httpClient );
@@ -166,12 +178,16 @@ protected function getClientMock()
166178 /**
167179 * Return a HttpMethods client mock
168180 *
181+ * @param array $methods
169182 * @return \Http\Client\Common\HttpMethodsClient
170183 */
171184 protected function getHttpMethodsMock (array $ methods = array ())
172185 {
173186 $ methods = array_merge (array ('sendRequest ' ), $ methods );
174- $ mock = $ this ->getMock ('Http\Client\Common\HttpMethodsClient ' , $ methods , array (), '' , false );
187+ $ mock = $ this ->getMockBuilder ('Http\Client\Common\HttpMethodsClient ' )
188+ ->disableOriginalConstructor ()
189+ ->setMethods ($ methods )
190+ ->getMock ();
175191 $ mock
176192 ->expects ($ this ->any ())
177193 ->method ('sendRequest ' );
@@ -183,7 +199,9 @@ protected function getHttpMethodsMock(array $methods = array())
183199 */
184200 protected function getHttpClientMock ()
185201 {
186- $ mock = $ this ->getMock ('Http\Client\HttpClient ' , array ('sendRequest ' ));
202+ $ mock = $ this ->getMockBuilder ('Http\Client\HttpClient ' )
203+ ->setMethods (array ('sendRequest ' ))
204+ ->getMock ();
187205 $ mock
188206 ->expects ($ this ->any ())
189207 ->method ('sendRequest ' );
0 commit comments