Skip to content

Commit f1fa66e

Browse files
author
alaouy
committed
Updated test
1 parent 07dffec commit f1fa66e

File tree

1 file changed

+37
-37
lines changed

1 file changed

+37
-37
lines changed

tests/YoutubeTest.php

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function testGetCategories()
6969
$this->assertEquals('youtube#videoCategory', $response[0]->kind);
7070
//add all these assertions here in case the api is changed,
7171
//we can detect it instantly
72-
$this->assertObjectHasAttribute('snippet', $response[0]);
72+
$this->assertObjectHasProperty('snippet', $response[0]);
7373
}
7474

7575
public function testGetCommentThreadsByVideoId()
@@ -81,9 +81,9 @@ public function testGetCommentThreadsByVideoId()
8181
$this->assertEquals('youtube#commentThread', $response[0]->kind);
8282
//add all these assertions here in case the api is changed,
8383
//we can detect it instantly
84-
$this->assertObjectHasAttribute('etag', $response[0]);
85-
$this->assertObjectHasAttribute('id', $response[0]);
86-
$this->assertObjectHasAttribute('snippet', $response[0]);
84+
$this->assertObjectHasProperty('etag', $response[0]);
85+
$this->assertObjectHasProperty('id', $response[0]);
86+
$this->assertObjectHasProperty('snippet', $response[0]);
8787
}
8888

8989
public function testGetVideoInfo()
@@ -96,10 +96,10 @@ public function testGetVideoInfo()
9696
$this->assertEquals('youtube#video', $response->kind);
9797
//add all these assertions here in case the api is changed,
9898
//we can detect it instantly
99-
$this->assertObjectHasAttribute('statistics', $response);
100-
$this->assertObjectHasAttribute('status', $response);
101-
$this->assertObjectHasAttribute('snippet', $response);
102-
$this->assertObjectHasAttribute('contentDetails', $response);
99+
$this->assertObjectHasProperty('statistics', $response);
100+
$this->assertObjectHasProperty('status', $response);
101+
$this->assertObjectHasProperty('snippet', $response);
102+
$this->assertObjectHasProperty('contentDetails', $response);
103103
}
104104

105105
public function testGetLocalizedVideoInfo()
@@ -113,10 +113,10 @@ public function testGetLocalizedVideoInfo()
113113
$this->assertEquals('youtube#video', $response->kind);
114114
//add all these assertions here in case the api is changed,
115115
//we can detect it instantly
116-
$this->assertObjectHasAttribute('statistics', $response);
117-
$this->assertObjectHasAttribute('status', $response);
118-
$this->assertObjectHasAttribute('snippet', $response);
119-
$this->assertObjectHasAttribute('contentDetails', $response);
116+
$this->assertObjectHasProperty('statistics', $response);
117+
$this->assertObjectHasProperty('status', $response);
118+
$this->assertObjectHasProperty('snippet', $response);
119+
$this->assertObjectHasProperty('contentDetails', $response);
120120
}
121121

122122
public function testGetVideoInfoMultiple()
@@ -129,10 +129,10 @@ public function testGetVideoInfoMultiple()
129129
$this->assertEquals('youtube#video', $response[0]->kind);
130130
//add all these assertions here in case the api is changed,
131131
//we can detect it instantly
132-
$this->assertObjectHasAttribute('statistics', $response[0]);
133-
$this->assertObjectHasAttribute('status', $response[0]);
134-
$this->assertObjectHasAttribute('snippet', $response[0]);
135-
$this->assertObjectHasAttribute('contentDetails', $response[0]);
132+
$this->assertObjectHasProperty('statistics', $response[0]);
133+
$this->assertObjectHasProperty('status', $response[0]);
134+
$this->assertObjectHasProperty('snippet', $response[0]);
135+
$this->assertObjectHasProperty('contentDetails', $response[0]);
136136
}
137137

138138
public function testGetPopularVideos()
@@ -146,10 +146,10 @@ public function testGetPopularVideos()
146146
$this->assertNotNull('response');
147147
$this->assertEquals($maxResult, count($response));
148148
$this->assertEquals('youtube#video', $response[0]->kind);
149-
$this->assertObjectHasAttribute('statistics', $response[0]);
150-
$this->assertObjectHasAttribute('status', $response[0]);
151-
$this->assertObjectHasAttribute('snippet', $response[0]);
152-
$this->assertObjectHasAttribute('contentDetails', $response[0]);
149+
$this->assertObjectHasProperty('statistics', $response[0]);
150+
$this->assertObjectHasProperty('status', $response[0]);
151+
$this->assertObjectHasProperty('snippet', $response[0]);
152+
$this->assertObjectHasProperty('contentDetails', $response[0]);
153153
}
154154

155155
public function testSearch()
@@ -201,9 +201,9 @@ public function testGetChannelByHandle()
201201
$this->assertEquals('Google', $response->snippet->title);
202202
//add all these assertions here in case the api is changed,
203203
//we can detect it instantly
204-
$this->assertObjectHasAttribute('snippet', $response);
205-
$this->assertObjectHasAttribute('contentDetails', $response);
206-
$this->assertObjectHasAttribute('statistics', $response);
204+
$this->assertObjectHasProperty('snippet', $response);
205+
$this->assertObjectHasProperty('contentDetails', $response);
206+
$this->assertObjectHasProperty('statistics', $response);
207207
}
208208

209209
public function testGetChannelByName()
@@ -215,9 +215,9 @@ public function testGetChannelByName()
215215
$this->assertEquals('Google', $response->snippet->title);
216216
//add all these assertions here in case the api is changed,
217217
//we can detect it instantly
218-
$this->assertObjectHasAttribute('snippet', $response);
219-
$this->assertObjectHasAttribute('contentDetails', $response);
220-
$this->assertObjectHasAttribute('statistics', $response);
218+
$this->assertObjectHasProperty('snippet', $response);
219+
$this->assertObjectHasProperty('contentDetails', $response);
220+
$this->assertObjectHasProperty('statistics', $response);
221221
}
222222

223223
public function testGetChannelById()
@@ -227,15 +227,15 @@ public function testGetChannelById()
227227

228228
$this->assertEquals('youtube#channel', $response->kind);
229229
$this->assertEquals($channelId, $response->id);
230-
$this->assertObjectHasAttribute('snippet', $response);
231-
$this->assertObjectHasAttribute('contentDetails', $response);
232-
$this->assertObjectHasAttribute('statistics', $response);
230+
$this->assertObjectHasProperty('snippet', $response);
231+
$this->assertObjectHasProperty('contentDetails', $response);
232+
$this->assertObjectHasProperty('statistics', $response);
233233
}
234234

235235
public function testGetPlaylistsByChannelId()
236236
{
237-
$GOOGLE_CHANNELID = 'UCK8sQmJBp8GCxrOtXWBpyEA';
238-
$response = $this->youtube->getPlaylistsByChannelId($GOOGLE_CHANNELID);
237+
$channelId = 'UCK8sQmJBp8GCxrOtXWBpyEA';
238+
$response = $this->youtube->getPlaylistsByChannelId($channelId);
239239

240240
$this->assertTrue(count($response) > 0);
241241
$this->assertEquals('youtube#playlist', $response['results'][0]->kind);
@@ -245,8 +245,8 @@ public function testGetPlaylistsByChannelId()
245245
public function testGetPlaylistById()
246246
{
247247
//get one of the playlist
248-
$GOOGLE_CHANNELID = 'UCK8sQmJBp8GCxrOtXWBpyEA';
249-
$response = $this->youtube->getPlaylistsByChannelId($GOOGLE_CHANNELID);
248+
$channelId = 'UCK8sQmJBp8GCxrOtXWBpyEA';
249+
$response = $this->youtube->getPlaylistsByChannelId($channelId);
250250
$playlist = $response['results'][0];
251251

252252
$response = $this->youtube->getPlaylistById($playlist->id);
@@ -256,8 +256,8 @@ public function testGetPlaylistById()
256256
public function testGetPlaylistByMultipleIds()
257257
{
258258
//get one of the playlist
259-
$GOOGLE_CHANNELID = 'UCK8sQmJBp8GCxrOtXWBpyEA';
260-
$response = $this->youtube->getPlaylistsByChannelId($GOOGLE_CHANNELID);
259+
$channelId = 'UCK8sQmJBp8GCxrOtXWBpyEA';
260+
$response = $this->youtube->getPlaylistsByChannelId($channelId);
261261
$playlists = $response['results'];
262262

263263
$response = $this->youtube->getPlaylistById([$playlists[0]->id, $playlists[1]->id]);
@@ -292,8 +292,8 @@ public function testParseVIdException()
292292

293293
public function testGetActivitiesByChannelId()
294294
{
295-
$GOOGLE_CHANNELID = 'UCK8sQmJBp8GCxrOtXWBpyEA';
296-
$response = $this->youtube->getActivitiesByChannelId($GOOGLE_CHANNELID);
295+
$channelId = 'UCK8sQmJBp8GCxrOtXWBpyEA';
296+
$response = $this->youtube->getActivitiesByChannelId($channelId);
297297
$this->assertTrue(count($response) > 0);
298298
$this->assertEquals('youtube#activity', $response[0]->kind);
299299
// $this->assertEquals('Google', $response[0]->snippet->channelTitle);

0 commit comments

Comments
 (0)