<?php
/*************************************************************************

This file contains all working tests and can be used to run them all.

If you finish a new test you should add it to this file. For everything
else you should use your own run-file, e.g. run-chris.php

**************************************************************************/

// Require some files 
require_once ('simpletest/unit_tester.php');
require_once ('simpletest/web_tester.php');
require_once ('simpletest/reporter.php');
require_once ('simpletest-addons/show-passes.php');            // modified HtmlReporter


// ======================== Configuration ==================================

// Base URLs to the main CAcert sites
define('BASE_URL',      'www.cacert.org/');
//define('BASE_URL_WIKI', 'wiki.cacert.org/');    // Comment out to deactivate tests
//define('BASE_URL_BLOG', 'blog.cacert.org/');
//define('BASE_URL_BUGTRACKING', 'bugs.cacert.org/');


// ======================== Some users for Testing ========================

$user = array();

// unassured user
// used in login.php, lostpassword.php
//
// Behind the newemail email address is a script that automatically follows
// any cacert-link so verify the account.
$user['1']['username'] = 'chris-cacert-testaccount@netzpunkt.org';
$user['1']['newemail'] = sprintf('chris-cacert-autofollowlink-%s@netzpunkt.org', time()+1);
$user['1']['details']['fname'] = 'Testaccount';
$user['1']['details']['mname'] = 'T.';
$user['1']['details']['lname'] = 'Testman';
$user['1']['details']['suffix'] = 'Ltd.';
$user['1']['password'] = 'q1W"e3R$';
$user['1']['dob']['day']   = '15';
$user['1']['dob']['month'] = '3';
$user['1']['dob']['year']  = '1960';
$user['1']['lostpw']['questions']['1'] = 'a';
$user['1']['lostpw']['questions']['2'] = 'b';
$user['1']['lostpw']['questions']['3'] = 'c';
$user['1']['lostpw']['questions']['4'] = 'd';
$user['1']['lostpw']['questions']['5'] = 'e';
$user['1']['lostpw']['answers']['1'] = '1';
$user['1']['lostpw']['answers']['2'] = '2';
$user['1']['lostpw']['answers']['3'] = '3';
$user['1']['lostpw']['answers']['4'] = '4';
$user['1']['lostpw']['answers']['5'] = '5';


// dummy for new user tests
// used in join.php
// Behind this email address is a script that automatically follows
// any cacert-link so verify the account.
$user['2']['username'] = sprintf('chris-cacert-autofollowlink-%s@netzpunkt.org', time()+2);
$user['2']['password'] = 'q1W"e3R$';
$user['2']['dob']      = $user['1']['dob'];
$user['2']['lostpw']   = $user['1']['lostpw'];
$user['2']['details']['fname'] = 'Join';
$user['2']['details']['mname'] = 'F.';
$user['2']['details']['lname'] = 'Testerdy';
$user['2']['details']['suffix'] = 'Jr';




$test = & new GroupTest('running tests on '.BASE_URL.' ...');


// You may deactivate specific tests by uncommenting one or more of the
// following lines.
$test->addTestFile('testfiles/general-website.php');
$test->addTestFile('testfiles/login.php');
$test->addTestFile('testfiles/lostpassword.php');
$test->addTestFile('testfiles/join.php');
$test->addTestFile('testfiles/newemail.php');
$test->addTestFile('testfiles/change-details-password.php');
$test->addTestFile('testfiles/join-XSS.php');
$test->addTestFile('testfiles/change-details-XSS.php');




// ======================= Run Tests ====================================

if (TextReporter :: inCli()) {

	$test->run(new TextReporter());    // run in text mode

} else {

    $test->run(new ShowPasses());      // run in html mode - modified HtmlReporter showing Passes
#    $test->run(new HtmlReporter());    // run in html mode


}


?>