Skip to content
Snippets Groups Projects
Commit 5cc26124 authored by Patrick Radtke's avatar Patrick Radtke
Browse files

Fix config.php to use in broken tests

parent 231056f0
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,7 @@ namespace Test\SimpleSAML\Auth\Source;
use League\OAuth2\Client\Provider\AbstractProvider;
use League\OAuth2\Client\Token\AccessToken;
use Psr\Http\Message\RequestInterface;
use SimpleSAML\Configuration;
use SimpleSAML\Module\authoauth2\Auth\Source\LinkedInV2Auth;
class LinkedInV2AuthTest extends \PHPUnit_Framework_TestCase
......@@ -12,6 +13,9 @@ class LinkedInV2AuthTest extends \PHPUnit_Framework_TestCase
public static function setUpBeforeClass()
{
putenv('SIMPLESAMLPHP_CONFIG_DIR=' . dirname(dirname(dirname(__DIR__))) . '/config');
// When all tests are run at once, sometimes a Configuration is created prior to us
// setting the one we want to use for the test.
Configuration::clearInternalState();
}
/**
......
......@@ -7,6 +7,7 @@ use CirrusIdentity\SSP\Test\MockHttp;
use League\OAuth2\Client\Provider\AbstractProvider;
use League\OAuth2\Client\Provider\GenericResourceOwner;
use League\OAuth2\Client\Token\AccessToken;
use SimpleSAML\Configuration;
use SimpleSAML\Module\authoauth2\Auth\Source\OpenIDConnect;
use Test\SimpleSAML\MockOAuth2Provider;
use Test\SimpleSAML\MockOpenIDConnectProvider;
......@@ -23,6 +24,14 @@ class OpenIDConnectTest extends OAuth2Test
return new OpenIDConnect($info, $config);
}
public static function setUpBeforeClass()
{
putenv('SIMPLESAMLPHP_CONFIG_DIR=' . dirname(dirname(dirname(__DIR__))) . '/config');
// Some of the constructs in this test cause a Configuration to be created prior to us
// setting the one we want to use for the test.
Configuration::clearInternalState();
}
public function finalStepsDataProvider() {
return [
[
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment