@@ -60,11 +60,14 @@ public function testGetPublic()
6060 $ this ->client ->expects ($ this ->once ())
6161 ->method ('get ' )
6262 ->with ('/events ' )
63- ->will ($ this ->returnValue ( $ this -> response ) );
63+ ->willReturn ($ this ->response );
6464
65- $ this ->assertThat (
66- $ this ->object ->getPublic (),
67- $ this ->equalTo (json_decode ($ this ->response ->body ))
65+ $ response = json_decode ($ this ->response ->getBody ()->getContents ());
66+ $ this ->response ->getBody ()->rewind ();
67+
68+ $ this ->assertEquals (
69+ $ response ,
70+ $ this ->object ->getPublic ()
6871 );
6972 }
7073
@@ -80,11 +83,14 @@ public function testGetRepository()
8083 $ this ->client ->expects ($ this ->once ())
8184 ->method ('get ' )
8285 ->with ($ path )
83- ->will ($ this ->returnValue ($ this ->response ));
86+ ->willReturn ($ this ->response );
87+
88+ $ response = json_decode ($ this ->response ->getBody ()->getContents ());
89+ $ this ->response ->getBody ()->rewind ();
8490
85- $ this ->assertThat (
86- $ this -> object -> getRepository ( $ this -> owner , $ this -> repo ) ,
87- $ this ->equalTo ( json_decode ( $ this ->response -> body ) )
91+ $ this ->assertEquals (
92+ $ response ,
93+ $ this ->object -> getRepository ( $ this ->owner , $ this -> repo )
8894 );
8995 }
9096
@@ -100,11 +106,14 @@ public function testGetIssue()
100106 $ this ->client ->expects ($ this ->once ())
101107 ->method ('get ' )
102108 ->with ($ path )
103- ->will ($ this ->returnValue ($ this ->response ));
109+ ->willReturn ($ this ->response );
110+
111+ $ response = json_decode ($ this ->response ->getBody ()->getContents ());
112+ $ this ->response ->getBody ()->rewind ();
104113
105- $ this ->assertThat (
106- $ this -> object -> getIssue ( $ this -> owner , $ this -> repo ) ,
107- $ this ->equalTo ( json_decode ( $ this ->response -> body ) )
114+ $ this ->assertEquals (
115+ $ response ,
116+ $ this ->object -> getIssue ( $ this ->owner , $ this -> repo )
108117 );
109118 }
110119
@@ -120,11 +129,14 @@ public function testGetNetwork()
120129 $ this ->client ->expects ($ this ->once ())
121130 ->method ('get ' )
122131 ->with ($ path )
123- ->will ($ this ->returnValue ( $ this -> response ) );
132+ ->willReturn ($ this ->response );
124133
125- $ this ->assertThat (
126- $ this ->object ->getNetwork ($ this ->owner , $ this ->repo ),
127- $ this ->equalTo (json_decode ($ this ->response ->body ))
134+ $ response = json_decode ($ this ->response ->getBody ()->getContents ());
135+ $ this ->response ->getBody ()->rewind ();
136+
137+ $ this ->assertEquals (
138+ $ response ,
139+ $ this ->object ->getNetwork ($ this ->owner , $ this ->repo )
128140 );
129141 }
130142
@@ -140,11 +152,14 @@ public function testGetOrg()
140152 $ this ->client ->expects ($ this ->once ())
141153 ->method ('get ' )
142154 ->with ($ path )
143- ->will ($ this ->returnValue ($ this ->response ));
155+ ->willReturn ($ this ->response );
156+
157+ $ response = json_decode ($ this ->response ->getBody ()->getContents ());
158+ $ this ->response ->getBody ()->rewind ();
144159
145- $ this ->assertThat (
146- $ this -> object -> getOrg ( $ this -> owner ) ,
147- $ this ->equalTo ( json_decode ( $ this ->response -> body ) )
160+ $ this ->assertEquals (
161+ $ response ,
162+ $ this ->object -> getOrg ( $ this ->owner )
148163 );
149164 }
150165
@@ -160,11 +175,14 @@ public function testGetUser()
160175 $ this ->client ->expects ($ this ->once ())
161176 ->method ('get ' )
162177 ->with ($ path )
163- ->will ($ this ->returnValue ( $ this -> response ) );
178+ ->willReturn ($ this ->response );
164179
165- $ this ->assertThat (
166- $ this ->object ->getUser ($ this ->owner ),
167- $ this ->equalTo (json_decode ($ this ->response ->body ))
180+ $ response = json_decode ($ this ->response ->getBody ()->getContents ());
181+ $ this ->response ->getBody ()->rewind ();
182+
183+ $ this ->assertEquals (
184+ $ response ,
185+ $ this ->object ->getUser ($ this ->owner )
168186 );
169187 }
170188
@@ -180,11 +198,14 @@ public function testGetUserPublic()
180198 $ this ->client ->expects ($ this ->once ())
181199 ->method ('get ' )
182200 ->with ($ path )
183- ->will ($ this ->returnValue ($ this ->response ));
201+ ->willReturn ($ this ->response );
202+
203+ $ response = json_decode ($ this ->response ->getBody ()->getContents ());
204+ $ this ->response ->getBody ()->rewind ();
184205
185- $ this ->assertThat (
186- $ this -> object -> getUserPublic ( $ this -> owner ) ,
187- $ this ->equalTo ( json_decode ( $ this ->response -> body ) )
206+ $ this ->assertEquals (
207+ $ response ,
208+ $ this ->object -> getUserPublic ( $ this ->owner )
188209 );
189210 }
190211
@@ -200,11 +221,14 @@ public function testGetByUser()
200221 $ this ->client ->expects ($ this ->once ())
201222 ->method ('get ' )
202223 ->with ($ path )
203- ->will ($ this ->returnValue ($ this ->response ));
224+ ->willReturn ($ this ->response );
225+
226+ $ response = json_decode ($ this ->response ->getBody ()->getContents ());
227+ $ this ->response ->getBody ()->rewind ();
204228
205- $ this ->assertThat (
206- $ this -> object -> getByUser ( $ this -> owner ) ,
207- $ this ->equalTo ( json_decode ( $ this ->response -> body ) )
229+ $ this ->assertEquals (
230+ $ response ,
231+ $ this ->object -> getByUser ( $ this ->owner )
208232 );
209233 }
210234
@@ -220,11 +244,14 @@ public function testGetByUserPublic()
220244 $ this ->client ->expects ($ this ->once ())
221245 ->method ('get ' )
222246 ->with ($ path )
223- ->will ($ this ->returnValue ( $ this -> response ) );
247+ ->willReturn ($ this ->response );
224248
225- $ this ->assertThat (
226- $ this ->object ->getByUserPublic ($ this ->owner ),
227- $ this ->equalTo (json_decode ($ this ->response ->body ))
249+ $ response = json_decode ($ this ->response ->getBody ()->getContents ());
250+ $ this ->response ->getBody ()->rewind ();
251+
252+ $ this ->assertEquals (
253+ $ response ,
254+ $ this ->object ->getByUserPublic ($ this ->owner )
228255 );
229256 }
230257
@@ -240,11 +267,14 @@ public function testGetUserOrg()
240267 $ this ->client ->expects ($ this ->once ())
241268 ->method ('get ' )
242269 ->with ($ path )
243- ->will ($ this ->returnValue ($ this ->response ));
270+ ->willReturn ($ this ->response );
271+
272+ $ response = json_decode ($ this ->response ->getBody ()->getContents ());
273+ $ this ->response ->getBody ()->rewind ();
244274
245- $ this ->assertThat (
246- $ this -> object -> getUserOrg ( $ this -> owner , $ this -> repo ) ,
247- $ this ->equalTo ( json_decode ( $ this ->response -> body ) )
275+ $ this ->assertEquals (
276+ $ response ,
277+ $ this ->object -> getUserOrg ( $ this ->owner , $ this -> repo )
248278 );
249279 }
250280}
0 commit comments