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

Fix metadata test

parent 18885b31
No related branches found
No related tags found
No related merge requests found
......@@ -32,7 +32,7 @@ websso-single-sign-on:
path: /idp/singleSignOnService
defaults: { _controller: 'SimpleSAML\Module\saml\Controller\WebBrowserSingleSignOn::singleSignOnService' }
websso-artifact-resolution:
path: //idp/artifactResolutionService
path: /idp/artifactResolutionService
defaults: { _controller: 'SimpleSAML\Module\saml\Controller\WebBrowserSingleSignOn::artifactResolutionService' }
websso-metadata:
path: /idp/metadata
......
......@@ -10,7 +10,7 @@ use SimpleSAML\HTTP\RunnableResponse;
use SimpleSAML\Module\saml\Controller;
use SimpleSAML\Session;
use SimpleSAML\Utils;
//use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
/**
......@@ -84,14 +84,19 @@ class MetadataTest extends TestCase
*/
public function testMetadataAccess(bool $authenticated, bool $protected): void
{
$c = new Controller\ServiceProvider($this->config, $this->session);
$request = Request::create(
'/idp/metadata',
'GET',
);
$c = new Controller\Metadata($this->config, $this->session);
if ($authenticated === true || $protected === false) {
// Bypass authentication - mock being authenticated
$c->setAuthUtils($this->authUtils);
}
$result = $c->metadata('phpunit');
$result = $c->metadata($request);
if ($authenticated !== false && $protected !== true) {
// ($authenticated === true) or ($protected === 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