From d5fedb093a63a69110708f45decd727ba199e486 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 16 Jul 2024 23:38:20 +0200 Subject: [PATCH] Fix test --- src/Cas/Protocol/Cas20.php | 9 +++++---- tests/src/Cas/Protocol/Cas20Test.php | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Cas/Protocol/Cas20.php b/src/Cas/Protocol/Cas20.php index a0a736ef..319d09d5 100644 --- a/src/Cas/Protocol/Cas20.php +++ b/src/Cas/Protocol/Cas20.php @@ -117,9 +117,9 @@ public function getProxyGrantingTicketIOU(): ?string /** * @param string $username - * @return \SimpleSAML\CAS\XML\cas\AuthenticationSuccess + * @return \SimpleSAML\CAS\XML\cas\ServiceResponse */ - public function getValidateSuccessResponse(string $username): AuthenticationSuccess + public function getValidateSuccessResponse(string $username): ServiceResponse { $user = new User($username); @@ -157,9 +157,10 @@ public function getValidateSuccessResponse(string $username): AuthenticationSucc $attr, ); - $authenticationSucces = new AuthenticationSuccess($user, $attributes, $proxyGrantingTicket); + $authenticationSuccess = new AuthenticationSuccess($user, $attributes, $proxyGrantingTicket); + $serviceResponse = new ServiceResponse($authenticationSuccess); - return $authenticationSucces; + return $serviceResponse; } diff --git a/tests/src/Cas/Protocol/Cas20Test.php b/tests/src/Cas/Protocol/Cas20Test.php index 79c670e4..1517ef3b 100644 --- a/tests/src/Cas/Protocol/Cas20Test.php +++ b/tests/src/Cas/Protocol/Cas20Test.php @@ -54,6 +54,6 @@ public function testAttributeToXmlConversion(): void $xml = $casProtocol->getValidateSuccessResponse('myUser'); - $this->assertEquals($this->document->saveXML(), $xml); + $this->assertEquals($this->document->saveXML(), strval($xml)); } }