Skip to content
This repository was archived by the owner on Mar 23, 2024. It is now read-only.

Commit b0623c0

Browse files
committed
:octocat: remove dotenv dependency
1 parent 1a5033e commit b0623c0

File tree

4 files changed

+1
-242
lines changed

4 files changed

+1
-242
lines changed

composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
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
},

config/.env_example

Lines changed: 0 additions & 224 deletions
This file was deleted.

tests/API/OAuthAPITestAbstract.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
abstract 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{

tests/Providers/ProviderTestAbstract.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)