Skip to content

Commit 05d0127

Browse files
committed
Fix metadata test
1 parent 18885b3 commit 05d0127

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

modules/saml/routing/routes/routes.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ websso-single-sign-on:
3232
path: /idp/singleSignOnService
3333
defaults: { _controller: 'SimpleSAML\Module\saml\Controller\WebBrowserSingleSignOn::singleSignOnService' }
3434
websso-artifact-resolution:
35-
path: //idp/artifactResolutionService
35+
path: /idp/artifactResolutionService
3636
defaults: { _controller: 'SimpleSAML\Module\saml\Controller\WebBrowserSingleSignOn::artifactResolutionService' }
3737
websso-metadata:
3838
path: /idp/metadata

tests/modules/saml/lib/Controller/MetadataTest.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use SimpleSAML\Module\saml\Controller;
1111
use SimpleSAML\Session;
1212
use SimpleSAML\Utils;
13-
//use Symfony\Component\HttpFoundation\Request;
13+
use Symfony\Component\HttpFoundation\Request;
1414
use Symfony\Component\HttpFoundation\Response;
1515

1616
/**
@@ -84,14 +84,19 @@ public function requireAdmin(): void
8484
*/
8585
public function testMetadataAccess(bool $authenticated, bool $protected): void
8686
{
87-
$c = new Controller\ServiceProvider($this->config, $this->session);
87+
$request = Request::create(
88+
'/idp/metadata',
89+
'GET',
90+
);
91+
92+
$c = new Controller\Metadata($this->config, $this->session);
8893

8994
if ($authenticated === true || $protected === false) {
9095
// Bypass authentication - mock being authenticated
9196
$c->setAuthUtils($this->authUtils);
9297
}
9398

94-
$result = $c->metadata('phpunit');
99+
$result = $c->metadata($request);
95100

96101
if ($authenticated !== false && $protected !== true) {
97102
// ($authenticated === true) or ($protected === false)

0 commit comments

Comments
 (0)