/** * Returns the Logout Request defated, base64encoded, unsigned * * @param bool|null $deflate Whether or not we should 'gzdeflate' the request body before we return it. * * @return string Deflated base64 encoded Logout Request */ public function getRequest($deflate = null) { $subject = $this->_logoutRequest; if (is_null($deflate)) { $deflate = $this->_settings->shouldCompressRequests(); } if ($deflate) { $subject = gzdeflate($this->_logoutRequest); } return base64_encode($subject); }
/** * Tests shouldCompressRequests method of OneLogin_Saml2_Settings. * * @covers OneLogin_Saml2_settings::shouldCompressRequests */ public function testShouldCompressRequests() { //The default value should be true. $settings = new OneLogin_Saml2_Settings(); $this->assertTrue($settings->shouldCompressRequests()); $settingsDir = TEST_ROOT . '/settings/'; include $settingsDir . 'settings1.php'; //settings1.php contains a true value for compress => requests. $settings = new OneLogin_Saml2_Settings($settingsInfo); $this->assertTrue($settings->shouldCompressRequests()); $settingsDir = TEST_ROOT . '/settings/'; include $settingsDir . 'settings2.php'; //settings2 contains a false value for compress => requests. $settings = new OneLogin_Saml2_Settings($settingsInfo); $this->assertFalse($settings->shouldCompressRequests()); }