mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-08 01:15:37 +08:00
Add new tests, remove redundant code
This commit is contained in:
24
tests/SPC/store/CurlHookTest.php
Normal file
24
tests/SPC/store/CurlHookTest.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\Tests\store;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use SPC\store\CurlHook;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
class CurlHookTest extends TestCase
|
||||
{
|
||||
public function testSetupGithubToken()
|
||||
{
|
||||
$header = [];
|
||||
CurlHook::setupGithubToken('GET', 'https://example.com', $header);
|
||||
$this->assertEmpty($header);
|
||||
putenv('GITHUB_TOKEN=token');
|
||||
CurlHook::setupGithubToken('GET', 'https://example.com', $header);
|
||||
$this->assertEquals(['Authorization: Bearer token'], $header);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user