Skip to content
Snippets Groups Projects
Commit 43ab8b4a authored by Tim van Dijen's avatar Tim van Dijen
Browse files

Cleanup

parent e486a7ba
No related branches found
No related tags found
No related merge requests found
...@@ -70,7 +70,7 @@ abstract class StoreFactory implements Utils\ClearableState ...@@ -70,7 +70,7 @@ abstract class StoreFactory implements Utils\ClearableState
$c $c
); );
} }
/** @var \SimpleSAML\Store|false */ /** @var \SimpleSAML\Store\StoreInterface|false */
self::$instance = new $className(); self::$instance = new $className();
} }
......
...@@ -112,7 +112,6 @@ class RedisStoreTest extends TestCase ...@@ -112,7 +112,6 @@ class RedisStoreTest extends TestCase
], '[ARRAY]', 'simplesaml'); ], '[ARRAY]', 'simplesaml');
$this->assertInstanceOf(Store\RedisStore::class, $this->store); $this->assertInstanceOf(Store\RedisStore::class, $this->store);
$this->clearInstance($config, Configuration::class);
} }
...@@ -128,7 +127,6 @@ class RedisStoreTest extends TestCase ...@@ -128,7 +127,6 @@ class RedisStoreTest extends TestCase
], '[ARRAY]', 'simplesaml'); ], '[ARRAY]', 'simplesaml');
$this->assertInstanceOf(Store\RedisStore::class, $this->store); $this->assertInstanceOf(Store\RedisStore::class, $this->store);
$this->clearInstance($config, Configuration::class);
} }
...@@ -201,18 +199,4 @@ class RedisStoreTest extends TestCase ...@@ -201,18 +199,4 @@ class RedisStoreTest extends TestCase
$this->assertNull($res); $this->assertNull($res);
} }
/**
* @param \SimpleSAML\Configuration $service
* @param class-string $className
*/
protected function clearInstance(Configuration $service, string $className): void
{
$reflectedClass = new ReflectionClass($className);
$reflectedInstance = $reflectedClass->getProperty('instance');
$reflectedInstance->setAccessible(true);
$reflectedInstance->setValue($service, []);
$reflectedInstance->setAccessible(false);
}
} }
...@@ -144,26 +144,4 @@ class SQLStoreTest extends TestCase ...@@ -144,26 +144,4 @@ class SQLStoreTest extends TestCase
$this->assertNull($value); $this->assertNull($value);
} }
/**
*/
protected function tearDown(): void
{
$this->clearInstance(Configuration::getInstance(), Configuration::class);
}
/**
* @param \SimpleSAML\Configuration $service
* @param class-string $className
*/
protected function clearInstance(Configuration $service, string $className): void
{
$reflectedClass = new ReflectionClass($className);
$reflectedInstance = $reflectedClass->getProperty('instance');
$reflectedInstance->setAccessible(true);
$reflectedInstance->setValue($service, []);
$reflectedInstance->setAccessible(false);
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment