1313namespace chillerlan \OAuthTest \API ;
1414
1515use chillerlan \DotEnv \DotEnv ;
16- use chillerlan \Settings \SettingsContainerInterface ;
1716use chillerlan \OAuth \{Core \OAuthInterface , OAuthOptions };
1817use chillerlan \OAuthTest \{OAuthTestHttpClient , OAuthTestLogger , OAuthTestMemoryStorage };
18+ use chillerlan \Settings \SettingsContainerInterface ;
1919use PHPUnit \Framework \TestCase ;
2020use Psr \Http \Client \ClientInterface ;
2121use Psr \Http \Message \ResponseInterface ;
2222use Psr \Log \LoggerInterface ;
2323
2424use function chillerlan \HTTP \Psr7 \{get_json , get_xml };
25+ use function file_exists , ini_set ;
2526
2627abstract class APITestAbstract extends TestCase{
2728
@@ -83,9 +84,9 @@ abstract class APITestAbstract extends TestCase{
8384 protected $ http ;
8485
8586 protected function setUp ():void {
86- \ ini_set ('date.timezone ' , 'Europe/Amsterdam ' );
87+ ini_set ('date.timezone ' , 'Europe/Amsterdam ' );
8788
88- $ file = \ file_exists ($ this ->CFG .'/.env ' ) ? '.env ' : '.env_travis ' ;
89+ $ file = file_exists ($ this ->CFG .'/.env ' ) ? '.env ' : '.env_travis ' ;
8990 $ this ->dotEnv = (new DotEnv ($ this ->CFG , $ file ))->load ();
9091
9192 if ($ this ->dotEnv ->get ('IS_CI ' ) === 'TRUE ' ){
@@ -96,20 +97,15 @@ protected function setUp():void{
9697
9798 $ this ->testuser = $ this ->dotEnv ->get ($ this ->ENV .'_TESTUSER ' );
9899
99- $ options = [
100+ $ this -> options = new OAuthOptions ( [
100101 'key ' => $ this ->dotEnv ->get ($ this ->ENV .'_KEY ' ),
101102 'secret ' => $ this ->dotEnv ->get ($ this ->ENV .'_SECRET ' ),
102103 'tokenAutoRefresh ' => true ,
103104 // HTTPOptionsTrait
104105 'ca_info ' => $ this ->CFG .'/cacert.pem ' ,
105106 'userAgent ' => 'chillerlanPhpOAuth/3.0.0 +https://github.com/chillerlan/php-oauth ' ,
106- // testHTTPClient
107107 'sleep ' => $ this ->requestDelay ,
108- ];
109-
110- $ this ->options = new class ($ options ) extends OAuthOptions{
111- protected $ sleep ;
112- };
108+ ]);
113109
114110 $ this ->logger = new OAuthTestLogger ('debug ' );
115111 $ this ->storage = new OAuthTestMemoryStorage ($ this ->options , $ this ->CFG );
0 commit comments