majiameng /
OAuth2
| 1 | <?php |
||
| 2 | namespace Tests; |
||
| 3 | |||
| 4 | use PHPUnit\Framework\TestCase as BaseTestCase; |
||
| 5 | |||
| 6 | abstract class TestCase extends BaseTestCase |
||
| 7 | { |
||
| 8 | protected function setUp(): void |
||
| 9 | { |
||
| 10 | parent::setUp(); |
||
| 11 | // 模拟请求环境 |
||
| 12 | $_SERVER['HTTP_USER_AGENT'] = 'PHPUnit Test'; |
||
| 13 | $_SERVER['REMOTE_ADDR'] = '127.0.0.1'; |
||
| 14 | } |
||
| 15 | |||
| 16 | protected function getConfig($platform) |
||
|
0 ignored issues
–
show
|
|||
| 17 | { |
||
| 18 | return [ |
||
| 19 | 'app_id' => 'test_app_id', |
||
| 20 | 'app_secret' => 'test_app_secret', |
||
| 21 | 'scope' => 'test_scope', |
||
| 22 | 'callback' => 'http://localhost/callback', |
||
| 23 | 'response_type' => 'code', |
||
| 24 | 'grant_type' => 'authorization_code', |
||
| 25 | 'proxy_url' => null, |
||
| 26 | ]; |
||
| 27 | } |
||
| 28 | } |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.