for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Tests;
use PHPUnit\Framework\TestCase as BaseTestCase;
abstract class TestCase extends BaseTestCase
{
protected function setUp(): void
parent::setUp();
// 模拟请求环境
$_SERVER['HTTP_USER_AGENT'] = 'PHPUnit Test';
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
}
protected function getConfig($platform)
$platform
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
protected function getConfig(/** @scrutinizer ignore-unused */ $platform)
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
return [
'app_id' => 'test_app_id',
'app_secret' => 'test_app_secret',
'scope' => 'test_scope',
'callback' => 'http://localhost/callback',
'response_type' => 'code',
'grant_type' => 'authorization_code',
'proxy_url' => null,
];
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.