Skip to content

Commit 1c182a2

Browse files
authored
Merge pull request #5 from RickyNotaro/master
Fixing issue #4
2 parents 54eb9a9 + 3cdda9c commit 1c182a2

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

src/TwitchApi.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ public function getScope()
229229
}
230230

231231
/**
232-
* Returns true if the set API version is greate than v4
232+
* Returns true if the set API version is greater than v4
233233
*
234234
* @return bool
235235
*/

test/TwitchApiTest.php

+18-6
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,20 @@ public function testCanCreateClassWithMinimumOptions()
1111
{
1212
$twitchApi = new TwitchApi(['client_id' => 'CLIENT-ID']);
1313
$this->assertInstanceOf(TwitchApi::class, $twitchApi);
14+
15+
return $twitchApi;
16+
}
17+
18+
/**
19+
* @depends testCanCreateClassWithMinimumOptions
20+
*/
21+
public function testCanSetClientId(TwitchApi $twitchApi)
22+
{
23+
$options = [
24+
'client_id' => 'TEST_CLIENT_ID',
25+
];
26+
$twitchApi->setClientId($options['client_id']);
27+
$this->assertEquals($twitchApi->getClientId(), $options['client_id']);
1428
}
1529

1630
public function testCreateClassWithoutClientIdThrowsException()
@@ -46,13 +60,11 @@ public function testCanCreateClassWithValidOptions()
4660
$this->assertEquals($twitchApi->getScope(), $options['scope']);
4761
}
4862

49-
public function testApiVersionDefaultsTo5IfNotSpecificallySet()
63+
/**
64+
* @depends testCanCreateClassWithMinimumOptions
65+
*/
66+
public function testApiVersionDefaultsTo5IfNotSpecificallySet(TwitchApi $twitchApi)
5067
{
51-
$options = [
52-
'client_id' => 'CLIENT_ID',
53-
'api_version' => 5,
54-
];
55-
$twitchApi = new TwitchApi($options);
5668
$this->assertEquals($twitchApi->getApiVersion(), 5);
5769
}
5870

0 commit comments

Comments
 (0)