diff --git a/tests/modules/admin/lib/Controller/FederationTest.php b/tests/modules/admin/lib/Controller/FederationTest.php index efb007116b97681a1b809c1ada54e26d64703f60..c96641366d366a9bd38b95ccd06f8dd40201259c 100644 --- a/tests/modules/admin/lib/Controller/FederationTest.php +++ b/tests/modules/admin/lib/Controller/FederationTest.php @@ -46,6 +46,9 @@ class FederationTest extends TestCase /** @var string */ private $broken_metadata_xml = self::FRAMEWORK . '/metadata/xml/corrupted-metadata-selfsigned.xml'; + /** @var string */ + private $expired_metadata_xml = self::FRAMEWORK . '/metadata/xml/expired-metadata.xml'; + /** @var string */ private $ssp_metadata = self::FRAMEWORK . '/metadata/simplesamlphp/saml20-idp-remote_cert_selfsigned.php'; @@ -224,6 +227,25 @@ class FederationTest extends TestCase $this->assertNull($response->data['error']); } + /** + * @return void + */ + public function testMetadataConverterSkipsExpires(): void + { + $request = Request::create( + '/federation/metadata-converter', + 'POST', + ['xmldata' => file_get_contents($this->expired_metadata_xml)] + ); + + $c = new Controller\Federation($this->config); + $c->setAuthUtils($this->authUtils); + $response = $c->metadataConverter($request); + + $this->assertTrue($response->isSuccessful()); + $this->assertStringNotContainsString("'expire' =>", $response->data['output']['saml20-idp-remote']); + } + /** * @return void