From aa072062fe5df5f6a49d95b62b718c3652bff536 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Wed, 19 Feb 2020 22:06:40 +0100 Subject: [PATCH] Fix tests --- tests/config/config.php | 4 ++++ www/loggedIn.php | 2 +- www/loggedOut.php | 2 +- www/login.php | 4 ++-- www/logout.php | 2 +- www/proxy.php | 6 +++--- www/utility/validateTicket.php | 6 +++--- www/validate.php | 6 +++--- 8 files changed, 18 insertions(+), 14 deletions(-) diff --git a/tests/config/config.php b/tests/config/config.php index d8d77c0..f13cbba 100644 --- a/tests/config/config.php +++ b/tests/config/config.php @@ -7,12 +7,16 @@ */ $config = [ 'baseurlpath' => '/', + 'tempdir' => '/tmp/simplesaml', + 'loggingdir' => '/tmp/simplesaml', + 'secretsalt' => 'salty', 'metadata.sources' => [ ['type' => 'flatfile', 'directory' => dirname(__DIR__) . '/metadata'], ], 'module.enable' => [ + 'casserver' => true, 'exampleauth' => true ], diff --git a/www/loggedIn.php b/www/loggedIn.php index 4597e02..0ca209e 100644 --- a/www/loggedIn.php +++ b/www/loggedIn.php @@ -25,6 +25,6 @@ $globalConfig = \SimpleSAML\Configuration::getInstance(); -$t = new \SimpleSAML\XHTML\Template($globalConfig, 'casserver:loggedIn.php'); +$t = new \SimpleSAML\XHTML\Template($globalConfig, 'casserver:loggedIn.twig'); $t->send(); diff --git a/www/loggedOut.php b/www/loggedOut.php index 3950e43..cb5430e 100644 --- a/www/loggedOut.php +++ b/www/loggedOut.php @@ -25,7 +25,7 @@ $globalConfig = \SimpleSAML\Configuration::getInstance(); -$t = new \SimpleSAML\XHTML\Template($globalConfig, 'casserver:loggedOut.php'); +$t = new \SimpleSAML\XHTML\Template($globalConfig, 'casserver:loggedOut.twig'); if (array_key_exists('url', $_GET)) { $t->data['url'] = $_GET['url']; diff --git a/www/login.php b/www/login.php index 4b25ccf..96d01ba 100644 --- a/www/login.php +++ b/www/login.php @@ -88,12 +88,12 @@ } $ticketStoreConfig = $casconfig->getValue('ticketstore', ['class' => 'casserver:FileSystemTicketStore']); -$ticketStoreClass = Module::resolveClass($ticketStoreConfig['class'], 'Cas_Ticket'); +$ticketStoreClass = Module::resolveClass($ticketStoreConfig['class'], 'Cas\Ticket'); /** @var $ticketStore TicketStore */ /** @psalm-suppress InvalidStringClass */ $ticketStore = new $ticketStoreClass($casconfig); -$ticketFactoryClass = Module::resolveClass('casserver:TicketFactory', 'Cas_Ticket'); +$ticketFactoryClass = Module::resolveClass('casserver:TicketFactory', 'Cas\Ticket'); /** @var $ticketFactory TicketFactory */ /** @psalm-suppress InvalidStringClass */ $ticketFactory = new $ticketFactoryClass($casconfig); diff --git a/www/logout.php b/www/logout.php index 46ffd6e..a429b73 100644 --- a/www/logout.php +++ b/www/logout.php @@ -51,7 +51,7 @@ if (!is_null($session)) { $ticketStoreConfig = $casconfig->getValue('ticketstore', ['class' => 'casserver:FileSystemTicketStore']); - $ticketStoreClass = \SimpleSAML\Module::resolveClass($ticketStoreConfig['class'], 'Cas_Ticket'); + $ticketStoreClass = \SimpleSAML\Module::resolveClass($ticketStoreConfig['class'], 'Cas\Ticket'); /** @psalm-suppress InvalidStringClass */ $ticketStore = new $ticketStoreClass($casconfig); diff --git a/www/proxy.php b/www/proxy.php index 42da32c..392d5aa 100644 --- a/www/proxy.php +++ b/www/proxy.php @@ -30,7 +30,7 @@ $casconfig = \SimpleSAML\Configuration::getConfig('module_casserver.php'); /* Instantiate protocol handler */ -$protocolClass = \SimpleSAML\Module::resolveClass('casserver:Cas20', 'Cas_Protocol'); +$protocolClass = \SimpleSAML\Module::resolveClass('casserver:Cas20', 'Cas\Protocol'); /** @psalm-suppress InvalidStringClass */ $protocol = new $protocolClass($casconfig); @@ -41,11 +41,11 @@ checkServiceURL(sanitize($_GET['targetService']), $legal_target_service_urls) && array_key_exists('pgt', $_GET) ) { $ticketStoreConfig = $casconfig->getValue('ticketstore', ['class' => 'casserver:FileSystemTicketStore']); - $ticketStoreClass = \SimpleSAML\Module::resolveClass($ticketStoreConfig['class'], 'Cas_Ticket'); + $ticketStoreClass = \SimpleSAML\Module::resolveClass($ticketStoreConfig['class'], 'Cas\Ticket'); /** @psalm-suppress InvalidStringClass */ $ticketStore = new $ticketStoreClass($casconfig); - $ticketFactoryClass = \SimpleSAML\Module::resolveClass('casserver:TicketFactory', 'Cas_Ticket'); + $ticketFactoryClass = \SimpleSAML\Module::resolveClass('casserver:TicketFactory', 'Cas\Ticket'); /** @psalm-suppress InvalidStringClass */ $ticketFactory = new $ticketFactoryClass($casconfig); diff --git a/www/utility/validateTicket.php b/www/utility/validateTicket.php index 1881fc4..6118354 100644 --- a/www/utility/validateTicket.php +++ b/www/utility/validateTicket.php @@ -37,7 +37,7 @@ $casconfig = \SimpleSAML\Configuration::getConfig('module_casserver.php'); /* Instantiate protocol handler */ -$protocolClass = \SimpleSAML\Module::resolveClass('casserver:Cas20', 'Cas_Protocol'); +$protocolClass = \SimpleSAML\Module::resolveClass('casserver:Cas20', 'Cas\Protocol'); /** @var Cas20 $protocol */ /** @psalm-suppress InvalidStringClass */ $protocol = new $protocolClass($casconfig); @@ -48,12 +48,12 @@ try { $ticketStoreConfig = $casconfig->getValue('ticketstore', ['class' => 'casserver:FileSystemTicketStore']); - $ticketStoreClass = \SimpleSAML\Module::resolveClass($ticketStoreConfig['class'], 'Cas_Ticket'); + $ticketStoreClass = \SimpleSAML\Module::resolveClass($ticketStoreConfig['class'], 'Cas\Ticket'); /** @var TicketStore $ticketStore */ /** @psalm-suppress InvalidStringClass */ $ticketStore = new $ticketStoreClass($casconfig); - $ticketFactoryClass = SimpleSAML\Module::resolveClass('casserver:TicketFactory', 'Cas_Ticket'); + $ticketFactoryClass = SimpleSAML\Module::resolveClass('casserver:TicketFactory', 'Cas\Ticket'); /** @var TicketFactory $ticketFactory */ /** @psalm-suppress InvalidStringClass */ $ticketFactory = new $ticketFactoryClass($casconfig); diff --git a/www/validate.php b/www/validate.php index 8257d83..0bad51a 100644 --- a/www/validate.php +++ b/www/validate.php @@ -32,7 +32,7 @@ $casconfig = \SimpleSAML\Configuration::getConfig('module_casserver.php'); /* Instantiate protocol handler */ -$protocolClass = \SimpleSAML\Module::resolveClass('casserver:Cas10', 'Cas_Protocol'); +$protocolClass = \SimpleSAML\Module::resolveClass('casserver:Cas10', 'Cas\Protocol'); /** @psalm-suppress InvalidStringClass */ $protocol = new $protocolClass($casconfig); @@ -42,11 +42,11 @@ try { /* Instantiate ticket store */ $ticketStoreConfig = $casconfig->getValue('ticketstore', ['class' => 'casserver:FileSystemTicketStore']); - $ticketStoreClass = \SimpleSAML\Module::resolveClass($ticketStoreConfig['class'], 'Cas_Ticket'); + $ticketStoreClass = \SimpleSAML\Module::resolveClass($ticketStoreConfig['class'], 'Cas\Ticket'); /** @psalm-suppress InvalidStringClass */ $ticketStore = new $ticketStoreClass($casconfig); - $ticketFactoryClass = \SimpleSAML\Module::resolveClass('casserver:TicketFactory', 'Cas_Ticket'); + $ticketFactoryClass = \SimpleSAML\Module::resolveClass('casserver:TicketFactory', 'Cas\Ticket'); /** @psalm-suppress InvalidStringClass */ $ticketFactory = new $ticketFactoryClass($casconfig);