Skip to content

Commit 0693fe8

Browse files
authored
Merge pull request #10 from BJTheCod3r/feature---changed-method-access
Feature changed method access
2 parents 637a128 + 8f70da3 commit 0693fe8

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ gladly attend to it.
5959

6060
## Todo
6161

62-
* Add Tests
62+
* Improve tests
6363
* Add the remaining useful features available on Cloudflare Stream
6464

6565
## Contributing

src/CloudflareStream.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ private function setCustomerDomain(): void
428428
*/
429429
public function getSignedUrl(string $id, int $expiresIn = 3600): array
430430
{
431-
$token = $this->signToken($id, $expiresIn);
431+
$token = $this->getLocallySignedToken($id, $expiresIn);
432432
return [
433433
'hls' => "$this->customerDomain/$token/manifest/video.m3u8",
434434
'dash' => "$this->customerDomain/$token/manifest/video.mpd"
@@ -440,7 +440,7 @@ public function getSignedUrl(string $id, int $expiresIn = 3600): array
440440
* @param int|null $exp
441441
* @return string
442442
*/
443-
private function signToken(string $uid, int $exp = null): string
443+
public function getLocallySignedToken(string $uid, int $exp = null): string
444444
{
445445
$privateKey = base64_decode($this->pem);
446446

tests/Feature/CloudflareStreamTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,6 @@ class CloudflareStreamTest extends TestCase
1313

1414
protected string $accountId;
1515

16-
protected function setUp(): void
17-
{
18-
parent::setUp();
19-
$this->apiBaseUrl = config('cloudflare-stream.base_url');
20-
$this->accountId = config('cloudflare-stream.account_id');
21-
}
22-
2316
/**
2417
* @return void
2518
*/
@@ -295,4 +288,11 @@ public function test_can_get_stream_signed_token_successfully(): void
295288
$response = $stream->getStreamSignedToken($id);
296289
$this->assertEquals($fakeResponse['result']['token'], $response['result']['token']);
297290
}
291+
292+
protected function setUp(): void
293+
{
294+
parent::setUp();
295+
$this->apiBaseUrl = config('cloudflare-stream.base_url');
296+
$this->accountId = config('cloudflare-stream.account_id');
297+
}
298298
}

0 commit comments

Comments
 (0)