Add new tests, remove redundant code

This commit is contained in:
crazywhalecc
2024-10-03 14:52:46 +08:00
committed by Jerry Ma
parent c800e3b93a
commit 732fa06abb
14 changed files with 2021 additions and 1050 deletions

View 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);
}
}