WebTestCase('general website'); } // Is our Main site online? function test_frontpage() { if (!defined('BASE_URL')) die("HELP! Can't run tests without BASE_URL defined."); $protocols = array("http", "https"); foreach ($protocols as $protocol) { $this->get($protocol.'http://' . BASE_URL); // Frontpage $this->assertText('Login'); // Login available? $this->assertText('Contact Us'); // Page complete? // Done in login.php // $this->clickLink('Normal Login'); // $this->assertText('Pass Phrase'); // Login fields? // Done in lostpassword.php // $this->clickLink('Lost Password'); // $this->assertText('Date of Birth'); // DoB fields? // Done in join.php // $this->clickLink('Join'); // $this->assertText('Pass Phrase Again'); $this->clickLink('Contact Us'); $this->assertText('P.O. Box 81'); $this->assertText('Banksia NSW 2216'); $this->assertText('Australia'); $this->assertText('Sensitive Information'); // WARNING: These tests can't improve security as an attacker can easily leave the // correct values as comments in it page. It's just agains human failure and similar bugs. $this->clickLink('Root Certificate'); $this->assertText('A6:1B:37:5E:39:0D:9C:36:54:EE:BD:20:31:46:1F:6B', "md5 fingerprint changed"); $this->assertText('135C EC36 F49C B8E9 3B1A B270 CD80 8846 76CE 8F33', "SHA1 fingerprint changed"); $this->clickLink('Root Certificate (PEM Format)'); $this->assertMime(array('text/plain', 'application/x-x509-ca-cert'), "root certificate (PEM) had bad mime type"); $this->assertText('MIIFtTCCA52gAwIBAgIJAIcrJlieqX3vMA0GCSqGSIb3DQEBBAUAMEUxCzAJBgNV', "first line of root certificate (PEM) was wrong! Thats OK if running on www.cacert.org"); $this->assertText('MIIHPTCCBSWgAwIBAgIBADANBgkqhkiG9w0BAQQFADB5MRAwDgYDVQQKEwdSb290', "first line of root certificate (PEM) was wrong! Thats OK if running on www.test1.cacert.at"); } } // Switching languages possible? function test_languages() { // XXX TODO return; // not available in test system if (!defined('BASE_URL')) die("HELP! Can't run tests without BASE_URL defined."); $this->get('http://' . BASE_URL.'index.php?id=0&lang=de_DE'); // Other language $this->assertText('Weitere Informationen'); // Page complete? $this->get('https://' . BASE_URL.'index.php?id=0&lang=de_DE'); // Other language $this->assertText('Weitere Informationen'); // Page complete? } // Is our Wiki online? function test_wiki() { if (!defined('BASE_URL_WIKI')) { echo " wiki tests skipped."; return;} $this->get('http://' . BASE_URL_WIKI); $this->assertText('Welcome to the CAcert Wiki'); // Does site show up? } // Is our Blog online? function test_blog() { if (!defined('BASE_URL_BLOG')) { echo " blog tests skipped."; return;} $this->get('http://' . BASE_URL_BLOG); $this->assertText('CAcert NEWS Blog'); // Does site show up? } // Is our bugtracking system online? function test_bugtracking() { if (!defined('BASE_URL_BUGTRACKING')) { echo " bugtracking tests skipped."; return;} $this->get('http://' . BASE_URL_BUGTRACKING); $this->assertText('Signup for a new account'); // Does site show up? } } ?>