This repository was archived by the owner on Mar 23, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +1
-242
lines changed
Expand file tree Collapse file tree 4 files changed +1
-242
lines changed Original file line number Diff line number Diff line change 3535 "psr/log" : " ^1.1"
3636 },
3737 "require-dev" : {
38- "chillerlan/php-dotenv" : " ^2.1" ,
3938 "phan/phan" : " ^4.0" ,
4039 "phpunit/phpunit" : " ^9.5"
4140 },
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 2020
2121abstract class OAuthAPITestAbstract extends ProviderTestAbstract{
2222
23- protected string $ ENV ;
23+ protected string $ CFG ;
2424
2525 /** a test username for live API tests, defined in .env as {ENV-PREFIX}_TESTUSER*/
2626 protected string $ testuser ;
@@ -32,15 +32,6 @@ protected function setUp():void{
3232 $ this ->markTestSkipped ('not on CI (set TEST_IS_CI in phpunit.xml to "false" if you want to run live API tests) ' );
3333 }
3434
35- $ this ->testuser = (string )$ this ->dotEnv ->get ($ this ->ENV .'_TESTUSER ' );
36- }
37-
38- protected function initOptions ():SettingsContainerInterface {
39- return new OAuthOptions ([
40- 'key ' => $ this ->dotEnv ->get ($ this ->ENV .'_KEY ' ),
41- 'secret ' => $ this ->dotEnv ->get ($ this ->ENV .'_SECRET ' ),
42- 'tokenAutoRefresh ' => true ,
43- ]);
4435 }
4536
4637 protected function initStorage (SettingsContainerInterface $ options ):OAuthStorageInterface {
Original file line number Diff line number Diff line change @@ -41,7 +41,6 @@ abstract class ProviderTestAbstract extends TestCase{
4141 protected SettingsContainerInterface $ options ;
4242 protected OAuthInterface $ provider ;
4343 protected OAuthStorageInterface $ storage ;
44- protected DotEnv $ dotEnv ;
4544
4645 // PSR interfaces
4746 protected RequestFactoryInterface $ requestFactory ;
@@ -53,19 +52,13 @@ abstract class ProviderTestAbstract extends TestCase{
5352
5453 protected ReflectionClass $ reflection ;
5554 // config dir & fqcn of the test subject
56- protected string $ CFG = __DIR__ .'/../../config ' ;
5755 protected string $ FQN ;
5856 protected bool $ is_ci ;
5957 protected array $ testResponses = [];
6058
6159 protected function setUp ():void {
6260 ini_set ('date.timezone ' , 'Europe/Amsterdam ' );
6361
64- // get the .env config
65- $ this ->CFG = realpath ($ this ->CFG );
66- $ envFile = file_exists ($ this ->CFG .DIRECTORY_SEPARATOR .'.env ' ) ? '.env ' : '.env_example ' ;
67- $ this ->dotEnv = (new DotEnv ($ this ->CFG , $ envFile ))->load ();
68-
6962 // are we running on CI? (travis, github) -> see phpunit.xml
7063 $ this ->is_ci = defined ('TEST_IS_CI ' ) && constant ('TEST_IS_CI ' ) === true ;
7164
You can’t perform that action at this time.
0 commit comments