mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
Fix curl hook test
This commit is contained in:
parent
3f55d0cec3
commit
3bdeafa6b6
@ -16,7 +16,11 @@ class CurlHookTest extends TestCase
|
||||
{
|
||||
$header = [];
|
||||
CurlHook::setupGithubToken('GET', 'https://example.com', $header);
|
||||
if (getenv('GITHUB_TOKEN') === false) {
|
||||
$this->assertEmpty($header);
|
||||
} else {
|
||||
$this->assertEquals(['Authorization: Bearer ' . getenv('GITHUB_TOKEN')], $header);
|
||||
}
|
||||
putenv('GITHUB_TOKEN=token');
|
||||
CurlHook::setupGithubToken('GET', 'https://example.com', $header);
|
||||
$this->assertEquals(['Authorization: Bearer token'], $header);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user