Skip to content

Commit 3d63cce

Browse files
committed
Add testFetchCuratedPodcastsLists
1 parent 563d6b1 commit 3d63cce

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/PodcastApiClientTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,22 @@ public function testFetchCuratedPodcastsListById(): void
137137
$this->assertSame( $arrUrl['path'], '/api/v2/curated_podcasts/' . $arrOptions['id'] );
138138
}
139139

140+
public function testFetchCuratedPodcastsLists(): void
141+
{
142+
$objClient = $this->podcastApiClient;
143+
$arrOptions = [ 'page' => '3' ];
144+
$strResponse = $objClient->fetchCuratedPodcastsLists( $arrOptions );
145+
$objResponse = json_decode( $strResponse );
146+
147+
$this->assertObjectHasAttribute( 'curated_lists', $objResponse );
148+
$this->assertGreaterThan( 0, count( $objResponse->curated_lists ) );
149+
$this->assertSame( $objClient->getMethod(), 'GET' );
150+
$arrUrl = parse_url( $objClient->getUri() );
151+
$this->assertSame( $arrUrl['path'], '/api/v2/curated_podcasts' );
152+
parse_str( $arrUrl['query'], $arrQuery );
153+
$this->assertSame( $arrQuery['page'], $arrOptions['page'] );
154+
}
155+
140156
public function testBatchFetchPodcasts(): void
141157
{
142158
$objClient = $this->podcastApiClient;

0 commit comments

Comments
 (0)