Skip to content

Commit 0fdb8a7

Browse files
authored
Merge pull request #19 from halnique/hotfix/access_token_existence
check access token existence
2 parents c978828 + fea3764 commit 0fdb8a7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/WebAPI/Endpoints/WithAuthenticate.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ public function token(): string
99
{
1010
$token = getenv('SLACK_API_ACCESS_TOKEN');
1111

12-
if (!$token) {
12+
if ($token === false) {
1313
throw new \RuntimeException('Require Slack Api Access Token to set env: SLACK_API_ACCESS_TOKEN');
1414
}
1515

1616
return $token;
1717
}
18-
}
18+
}

tests/WebAPI/Endpoints/WithAuthenticateTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function testToken()
2222
*/
2323
public function testTokenException()
2424
{
25-
putenv('SLACK_API_ACCESS_TOKEN=');
25+
putenv('SLACK_API_ACCESS_TOKEN');
2626
/** @var WithAuthenticate $withAuthenticate */
2727
$withAuthenticate = $this->getMockForTrait(WithAuthenticate::class);
2828
$this->expectException(\RuntimeException::class);

0 commit comments

Comments
 (0)