function test_discoverRetainSSL()
 {
     // In the presence of SSL support, the discovery process
     // should NOT drop endpoints whose server URLs are HTTPS.
     // In the absence of SSL support, the discovery process should
     // drop endpoints whose server URLs are HTTPS.
     $id_url = 'http://bogus/';
     $d = array($id_url => array('application/xrds+xml', Tests_Auth_OpenID_readdata('test_discover_openid_ssl.xml')));
     $f =& new _FetcherWithSSL($d);
     $result = Auth_OpenID_discover($id_url, $f);
     list($url, $services) = $result;
     $this->assertTrue($url == $id_url);
     $this->assertTrue(count($services) == 2);
     $e = $services[0];
     $this->assertTrue($e->server_url == 'http://nossl.vroom.unittest/server');
     $e = $services[1];
     $this->assertTrue($e->server_url == 'https://ssl.vroom.unittest/server');
 }
示例#2
0
 function Tests_Auth_OpenID_Parse()
 {
     $test_data = Tests_Auth_OpenID_readdata('linkparse.txt');
     list($num_tests, $test_cases) = $this->parseTests($test_data);
     $this->addTest(new NumTestCases($test_cases, $num_tests));
     foreach ($test_cases as $case) {
         $this->addTest(new Tests_Auth_OpenID_Link($case));
     }
 }
示例#3
0
function Tests_Auth_OpenID_trustRootTests()
{
    $data = Tests_Auth_OpenID_readdata('trustroot.txt');
    list($parsehead, $matchhead) = Tests_Auth_OpenID_parseHeadings($data, '=');
    $pe = $parsehead['end'];
    $parsedata = substr($data, $pe, $matchhead['start'] - $pe);
    $parsetests = Tests_Auth_OpenID_getSections($parsedata);
    $parsecases = Tests_Auth_OpenID_trParseTests($parsehead['heading'], $parsetests);
    $matchdata = substr($data, $matchhead['end']);
    $matchtests = Tests_Auth_OpenID_getSections($matchdata);
    $matchcases = Tests_Auth_OpenID_trMatchTests($matchhead['heading'], $matchtests);
    return array_merge($parsecases, $matchcases);
}