/** * Format a CAS Server proxy ticket request URL. * * @param string $target_service * The service to be proxied. * * @return string * The fully formatted URL. */ private function getServerProxyURL($target_service) { $url = $this->casHelper->getServerBaseUrl() . 'proxy'; $params = array(); $params['pgt'] = $_SESSION['cas_pgt']; $params['targetService'] = $target_service; return $url . '?' . UrlHelper::buildQuery($params); }
/** * Test constructing the CAS Server base url. * * @covers ::getServerBaseUrl * @covers ::__construct */ public function testGetServerBaseUrl() { $config_factory = $this->getConfigFactoryStub(array('cas.settings' => array('server.hostname' => 'example.com', 'server.port' => 443, 'server.path' => '/cas'))); $cas_helper = new CasHelper($config_factory, $this->urlGenerator, $this->connection, $this->loggerFactory, $this->session); $this->assertEquals('https://example.com:443/cas/', $cas_helper->getServerBaseUrl()); }