public function testBasic()
 {
     runTest(1, 'boolean sanity');
     runTest(file_exists(COMMON_FILE_LOCATION), '/includes/common.php exists');
     require_once COMMON_FILE_LOCATION;
     runTest(class_exists('Database'), 'Database class exists');
     runTest(class_exists('ErrorHandler'), 'ErrorHandler class exists');
     runTest(intval(ini_get('register_globals')) == '0', 'Register globals turned off');
     runTest(get_magic_quotes_gpc() === 0, 'Magic quotes turned off');
     runTest(version_compare(PHP_VERSION, '5.0.0', '>'), 'PHP Version is reasonable');
     runTest(file_exists(CFG_FILE_PATH), 'Config file exists');
     require_once CFG_FILE_PATH;
     runTest(!is_writable(CFG_FILE_PATH), 'Config file is not writable from webserver', true);
     runTest(defined('CFG_DB_DSN'), 'Defined: DB_DSN');
     runTest(defined('CFG_DB_USER'), 'Defined: DB_USER');
     runTest(defined('CFG_DB_PASS'), 'Defined: DB_PASS');
     runTest(defined('CFG_PASSWORD_SALT'), 'Defined: password salt');
     runTest(strlen(CFG_PASSWORD_SALT) >= 15, 'Password salt length');
     runTest(file_exists(PWD . 'htdocs'), 'htdocs exists');
     runTest(function_exists('mysql_connect'), 'mysql_ functions are installed');
     runTest(function_exists('mysqli_connect'), 'mysqli_ functions are installed', true);
     runTest(class_exists('PDO'), 'PDO exists');
 }
Exemple #2
0
<?php

require_once 'test_base.inc';
function BadAuthDigestTestController($serverPort)
{
    $args = array('Authorization' => 'Digest "username="******", ' . 'realm="Restricted area", nonce="564a12f5c065e", ' . 'uri="/test_auth_digest.php", cnonce="MjIyMTg2", nc=00000001, ' . 'qop="auth", response="6dfbea52fbf13016476c1879e6436004", ' . 'opaque="cdce8a5c95a1427d74df7acbf41c9ce0"');
    var_dump(request(php_uname('n'), $serverPort, "test_auth_digest.php", [], [], $args));
}
function GoodAuthDigestTestController($serverPort)
{
    $args = array('Authorization' => 'Digest username="******", ' . 'realm="Restricted area", nonce="564a12611dae8", ' . 'uri="/test_auth_digest.php", cnonce="MjIyMTg1", nc=00000001, ' . 'qop="auth", response="e544aaed06917adea3e5c74dd49f0e32", ' . 'opaque="cdce8a5c95a1427d74df7acbf41c9ce0"');
    var_dump(request(php_uname('n'), $serverPort, "test_auth_digest.php", [], [], $args));
}
runTest("BadAuthDigestTestController");
runTest("GoodAuthDigestTestController");
// --------------------------------------------------------------------------------------------
$tcCounter++;
$method = 'createTestCaseSteps';
$unitTestDescription = "Test #{$tcCounter}- {$method}";
$args = array();
$args["devKey"] = DEV_KEY;
$args["testcaseexternalid"] = 'MKO-1';
$args["steps"][] = array('step_number' => 1, 'actions' => 'Start Server', 'expected_results' => 'green light');
$args["authorlogin"] = '******';
$debug = true;
echo $unitTestDescription;
$client = new IXR_Client($server_url);
$client->debug = $debug;
runTest($client, $method, $args, $tcCounter);
// ----------------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------
$tcCounter++;
$method = 'createTestCaseSteps';
$unitTestDescription = "Test #{$tcCounter}- {$method}";
$args = array();
$args["devKey"] = DEV_KEY;
$args["testcaseexternalid"] = 'MKO-1';
$args["version"] = 100;
$args["steps"][] = array('step_number' => 1, 'actions' => 'Start Server VERSION DOES NOT EXIST', 'expected_results' => 'green light');
$args["authorlogin"] = '******';
$debug = true;
echo $unitTestDescription;
$client = new IXR_Client($server_url);
$client->debug = $debug;
runTest($client, $method, $args, $tcCounter);
// ----------------------------------------------------------------------------------------------------
echo $unitTestDescription;
$answer = runTest($client, $method, $args);
// ---------------------------------------------------------------------------------------
$utc++;
$unitTestDescription = "Test #{$utc} - {$method} - Wrong argument - Test Case External ID ";
$args = array();
$args["devKey"] = $devKey;
$args["testplanid"] = 9;
$args["testcaseexternalid"] = 'GK-WRONG-1';
$args["buildname"] = 'WRONG - 1.0';
$args["platformname"] = 'P2';
$debug = true;
$client = new IXR_Client($server_url);
$client->debug = $debug;
echo $unitTestDescription;
$answer = runTest($client, $method, $args);
// ---------------------------------------------------------------------------------------
$utc++;
$unitTestDescription = "Test #{$utc} - {$method} - Wrong argument - Build Name ";
$args = array();
$args["devKey"] = $devKey;
$args["testplanid"] = 9;
$args["testcaseexternalid"] = 'GK-1';
$args["buildname"] = 'WRONG - 1.0';
$args["platformname"] = 'P2';
$debug = true;
$client = new IXR_Client($server_url);
$client->debug = $debug;
echo $unitTestDescription;
$answer = runTest($client, $method, $args);
// ---------------------------------------------------------------------------------------
Exemple #5
0
//        if (isset($backtrace['file'])) {
//            $line = $backtrace['line'];
//        } else {
//            $line = '?';
//        }
//        if (!isset($tab[$file])) {
//            $tab[$file] = [];
//        }
//        $tab[$file][(string) $line] = true;
//    }
//};
if (!isset($_GET['f'])) {
    //declare(ticks = 1);
    //register_tick_function($profile);
    xdebug_start_code_coverage();
    try {
        runTest(['core', 'app']);
    } catch (Exception $e) {
        echo $e->getMessage();
    }
    $couverture = xdebug_get_code_coverage();
    xdebug_stop_code_coverage();
    file_put_contents(ROOT . 'utilisation_fichier.srl.txt', serialize($couverture));
} else {
    $fileName = str_replace('{ROOT}', ROOT, urldecode($_GET['f']));
    if (is_file($fileName)) {
        afficheSourceTestee($fileName);
    } else {
        header('location: ' . filter_input(INPUT_SERVER, 'REQUEST_URI', FILTER_SANITIZE_URL), true, 404);
    }
}
function test_i(&$client, &$test_num)
{
    $method = 'createTestProject';
    $test_num++;
    $unitTestDescription = "Test {$test_num} - {$method}() ::: COPY AS ";
    $prefix = 'QAZ';
    $args = array();
    $args["devKey"] = DEV_KEY;
    $args["testcaseprefix"] = substr(md5($prefix . $test_num . rand()), 0, 12);
    $args["sourcename"] = "NAUTILUS";
    $args["testprojectname"] = "API - COPY OF " . $args["sourcename"] . ' ' . $args["testcaseprefix"];
    $dummy = '';
    $additionalInfo = $dummy;
    $args["notes"] = "test project created using XML-RPC-API - <br> {$additionalInfo}";
    echo $unitTestDescription . ' ' . $additionalInfo;
    $debug = true;
    $client->debug = $debug;
    runTest($client, $method, $args, $test_num);
}
$additionalInfo = $dummy;
$args["notes"] = "test project created using XML-RPC-API - <br> {$additionalInfo}";
echo $unitTestDescription . ' ' . $additionalInfo;
$answer = runTest($client, $method, $args, $step);
// Create Test Suite
$step++;
$method = 'createTestSuite';
$args = array();
$arg['prefix'] = $prefix;
$args["devKey"] = $devKey;
$args["testprojectid"] = $answer[0]['id'];
$args["testsuitename"] = 'TS API 2';
$args["details"] = 'This has been created by XMLRPC API Call';
$unitTestDescription = '';
$dummy = '';
$additionalInfo = $dummy;
echo $unitTestDescription . ' ' . $additionalInfo;
$answer = runTest($client, $method, $args, $step);
// Create Test Plan
$step++;
$method = 'createTestPlan';
$args = array();
$args['prefix'] = $prefix;
$args["devKey"] = $devKey;
$args["testplanname"] = 'TPLAN A';
$args["details"] = 'This has been created by XMLRPC API Call';
$dummy = '';
$additionalInfo = $dummy;
echo $unitTestDescription . ' ' . $additionalInfo;
$answer = runTest($client, $method, $args, $step);
Exemple #8
0
/**
 * Run the single unit test whose name is given in $_REQUEST['test'] and
 * display the results. If the unit test file was blah_test.php, then
 * $_REQUEST['test'] should be blah.
 */
function runTestBasedOnRequest()
{
    echo "<p><a href='?activity=listTests'>See test case list</a>.</p>";
    if (isset($_REQUEST['test'])) {
        $name = preg_replace("/[^A-Za-z_0-9]/", '', $_REQUEST['test']) . "_test.php";
        if (file_exists($name)) {
            runTest($name);
        }
    }
}
<?php

require_once __DIR__ . '/test_base.inc';
$requests = array(array('-dalways_populate_raw_post_data=1', ['CONTENT_TYPE' => 'multipart/form-data; boundary=dumy']), array('-dalways_populate_raw_post_data=1', []), array('', []), array('-dvariables_order=NONE -drequest_order=', []), array('-dvariables_order=E -drequest_order=GPC', []), array('-dvariables_order=CGP -drequest_order=GP', []), array('-dvariables_order=GC -drequest_order=CG', []), array('-dvariables_order=GC -drequest_order=GC', []), array('-dvariables_order=GC -drequest_order=P', []));
foreach ($requests as $request) {
    echo "------------ {$request[0]} --------\n";
    runTest(function ($port) use($request) {
        list($options, $extra) = $request;
        $path = 'global_variables.php?var=GET&get=1';
        $post = array('var' => 'POST', 'post' => 2);
        $headers = array('Cookie' => 'var=COOKIE;cookie=3;');
        echo request(php_uname('n'), $port, $path, $post, $headers, $extra) . "\n";
    }, $request[0]);
}
function allTests($className)
{
    global $_;
    $_->each(get_class_methods($className), function ($varName) {
        runTest($varName);
    });
}
Exemple #11
0
<?php

/* MorgOS is a Content Management System written in PHP
 * Copyright (C) 2005-2007 MorgOS
 * This program is free software; you can redistribute it and/or modify 
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * any later version.
 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Library General Public License for more details.
 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
*/
include_once '../../core/tests/compwrapper.class.php';
runTest('MorgOSInterface', 'interface/tests/runtests.5.php', 'interface/tests/base.php');
Exemple #12
0
<?php

require_once 'test_base.inc';
function invalidTestController($port)
{
    $host = php_uname('n');
    $filename = __DIR__ . '/request-doesnotexist.dat';
    $file = fopen($filename, 'rb');
    $req_dat = fread($file, filesize($filename));
    fclose($file);
    // Repeat the data three times, to make it invalid. This particular bytestream
    // (and ones like it -- repeat 3 times!) in particular used to tickle a
    // use-after-free in the FastCGI support.
    $req_dat = $req_dat . $req_dat . $req_dat;
    $sock = fsockopen($host, $port);
    fwrite($sock, $req_dat);
    fclose($sock);
    // Should still be able to recover and respond to a request over the port on a
    // new TCP connection.
    echo request($host, $port, 'hello.php');
    echo "\n";
}
runTest("invalidTestController");
Exemple #13
0
<?php

require "Octave_lib.php";
$instances = array('Ad hoc' => new Octave(false), 'Network' => new Octave("localhost"));
$tests = array('Initialization ($octave->init() x 1)' => 'test_init', 'Single command ($octave->run("A=1") x 1)' => 'test_single', 'Multiple commands ($octave->run("A=1") x 50)' => 'test_multiple', 'Single batch of multiple commands ($octave->run("A=1" x 50))' => 'test_batch', 'Long input ($octave->run("C=[...]"), C=eye(500))' => 'test_long_in', 'Long output ($octave->query("C"))' => 'test_long_out');
foreach ($tests as $testName => $testFunction) {
    echo "\nTest: " . $testName . "\n";
    foreach ($instances as $instanceName => $instance) {
        runTest($testFunction, $instanceName, $instance);
    }
}
function runTest($func, $name, $octave)
{
    $func($octave);
    echo $name . str_repeat(" ", 10 - strlen($name)) . toc() . "\n";
}
function test_init($octave)
{
    tic();
    $octave->init();
}
function test_single($octave)
{
    tic();
    $octave->run("A=1");
}
function test_multiple($octave)
{
    tic();
    for ($i = 0; $i < 50; $i++) {
        $octave->run("A=1");
// ----------------------------------------------------------------------------------------------------
// Now TRY TO Create EXISTENT STEP
$alienStartPos = intval($qtySteps / 3);
$aliens[] = array('step_number' => $alienStartPos, 'actions' => 'If you see this content => Houston we have a problem' . $action, 'expected_results' => 'Ripley Will BE INFECTED');
$args = $commonArgs;
$args["version"] = $cfg->tcaseVersionNumber;
$args["action"] = 'create';
$args['steps'] = $aliens;
$rr = runTest($client, 'createTestCaseSteps', $args, $tcCounter);
$ret = isset($rr[0]) ? $rr[0] : $rr;
if (isset($ret['code'])) {
    new dBug($ret);
    exit;
}
// ----------------------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------------------
// Now TRY TO UPDATE a NON EXISTENT STEP
$hint = 'You have requested UPDATE of NON EXISTENT Step => we will CREATE it';
$alienStartPos = 1000;
$aliens[] = array('step_number' => $alienStartPos, 'actions' => $hint . $action, 'expected_results' => 'Ripley Will BE INFECTED');
$args = $commonArgs;
$args["version"] = $cfg->tcaseVersionNumber;
$args["action"] = 'update';
$args['steps'] = $aliens;
$rr = runTest($client, 'createTestCaseSteps', $args, $tcCounter);
$ret = isset($rr[0]) ? $rr[0] : $rr;
if (isset($ret['code'])) {
    new dBug($ret);
    exit;
}
// ----------------------------------------------------------------------------------------------------
$client = new IXR_Client($server_url);
$client->debug = $debug;
runTest($client, $method, $args, $idx);
$idx++;
// --------------------------------------------------------------------------
$args = array();
$args["devKey"] = DEV_KEY;
$args["nodeid"] = -1;
$debug = true;
$client = new IXR_Client($server_url);
$client->debug = $debug;
runTest($client, $method, $args, $idx);
$idx++;
// --------------------------------------------------------------------------
$args = array();
$args["devKey"] = DEV_KEY;
$args["nodeid"] = 1;
$debug = true;
$client = new IXR_Client($server_url);
$client->debug = $debug;
runTest($client, $method, $args, $idx);
$idx++;
// --------------------------------------------------------------------------
$args = array();
$args["devKey"] = DEV_KEY;
$args["nodeid"] = 419;
$debug = true;
$client = new IXR_Client($server_url);
$client->debug = $debug;
runTest($client, $method, $args, $idx);
$idx++;
<?php

// Remove this test once we unify the zend ini compat diff (D1797805) with the
// per dir diff (D2099778)
require_once 'test_base.inc';
function disableIniZendCompatController($port)
{
    echo request(php_uname('n'), $port, 'test_disable_ini_zend_compat.php');
}
echo "---Enable Ini Zend Compat ON---\n";
runTest("disableIniZendCompatController", "-dhhvm.enable_zend_ini_compat=true");
echo "\n---Enable Ini Zend Compat OFF---\n";
runTest("disableIniZendCompatController", "-dhhvm.enable_zend_ini_compat=false");
Exemple #17
0
function readTests($filename)
{
    $lines = file($filename);
    $firstline = trim($lines[0]);
    if ($firstline[0] == '#') {
        echo '<tr><th colspan="3">' . $firstline . '</th></tr>';
    }
    $testData = array('fatal' => false, 'desc' => '(not given)', 'blazon' => '');
    $firstTest = true;
    $multi = false;
    foreach ($lines as $line) {
        $line = trim($line);
        if ($line == '' or $line[0] == '#') {
            continue;
        }
        $keyValue = explode(':', $line);
        $key = $keyValue[0];
        $value = count($keyValue) > 1 ? $keyValue[1] : '';
        if ($multi) {
            if ($value == '') {
                $testData['blazon'] .= " {$key}";
                continue;
            } else {
                $multi = false;
            }
        }
        if ($key == 'blazon' and $value == '') {
            $multi = true;
            continue;
        }
        if ($key == 'name') {
            if ($firstTest) {
                $success = true;
                $firstTest = false;
            } else {
                $success = runTest($testData);
            }
            if (!$success and array_key_exists('fatal', $testData) and $testData['fatal'] == 'true') {
                return false;
            }
            $testData = array('name' => $value, 'fatal' => false, 'desc' => '(not given)', 'blazon' => '');
        } else {
            $testData[$key] = $value;
        }
    }
    if (!$firstTest) {
        runTest($testData);
    }
    return true;
}
Exemple #18
0
<?php

require_once 'test_base.inc';
function httpsTestController($serverPort)
{
    $args = array('HTTPS' => '');
    var_dump(request(php_uname('n'), $serverPort, "test_https.php", [], [], $args));
}
runTest("httpsTestController");
Exemple #19
0
<?php

// This code gets called by Google App Engine's Cron mechanism. See "cron.yaml" in this project for schedule.
// refer to https://sites.google.com/a/webpagetest.org/docs/advanced-features/webpagetest-restful-apis
// for documentation related to REST API for webpagetest.
require 'vendor/autoload.php';
use GuzzleHttp\Client;
function runTest($path, $client, $loc)
{
    $response = $client->request('GET', 'http://www.webpagetest.org/runtest.php', ['query' => ['url' => 'http://jwplayer-1217.appspot.com/' . $path, 'k' => 'A.08928590c39b9648a4ad8992b0a31937', 'video' => '1', 'fvonly' => '1', 'location' => $loc]]);
    if ($response->getStatusCode() != 200) {
        syslog(LOG_ERR, "Bad HTTP Status code");
        print "Bad HTTP Status code<br>";
    } else {
        syslog(LOG_INFO, "Successful run.");
        print "Successful run: {$path} @ {$loc}<br>";
    }
}
$locations = array("Dulles:Chrome", "Dulles:Canary", "Dulles:Firefox", "Dulles:Firefox Nightly", "Dulles:Safari", "Dulles_IE11", "ec2-eu-west-1:Chrome", "ec2-ap-northeast-1:Chrome", "ec2-sa-east-1:Chrome", "ec2-us-west-1:Chrome", "ec2-us-east-1:Chrome", "ec2-eu-central-1:Chrome", "ec2-ap-southeast-1:Chrome", "ec2-us-west-2:Chrome", "ec2-ap-southeast-2:Chrome");
$client = new Client();
$location_count = count($locations);
// call the webpagetest.org runner from the different locations globally
for ($i = 0; $i < $location_count; $i++) {
    runTest('flash', $client, $locations[$i]);
    runTest('html5', $client, $locations[$i]);
    runTest('dash', $client, $locations[$i]);
    runTest('mp4', $client, $locations[$i]);
    runTest('library-mp4', $client, $locations[$i]);
}
Exemple #20
0
<?php

require_once 'test_base.inc';
function headerTestController($serverPort)
{
    $args = array('Authorization' => 'foo');
    var_dump(request(php_uname('n'), $serverPort, "test_headers.php", [], [], $args));
}
runTest("headerTestController");
Exemple #21
0
<?php

require_once 'test_base.php';
function test1Controller($hphpdOutput, $hphpdProcessId, $serverPort)
{
    // Request a page so that the client can debug it.
    waitForClientToOutput($hphpdOutput, "Waiting for server response");
    $url = "http://" . php_uname('n') . ':' . $serverPort . '/test1.php';
    echo "Requesting test1.php\n";
    request($url, 10);
    // proceed without waiting for a response
    // Let client run until script quits
    waitForClientToOutput($hphpdOutput, "quit");
}
runTest('test1', "test1Controller");
Exemple #22
0
function test05($cache)
{
    echo "Testing foreach loops...";
    $tmpl = new Scurvy('05_for.html', './', $cache);
    $tmpl->set('thing', array(array('var' => 0), array('var' => 1), array('var' => 2), array('var' => 3), array('var' => 4), array('var' => 5), array('var' => 6)));
    $output = $tmpl->render();
    file_put_contents('05_for.run', $output);
    return getDiff('05_for.out', '05_for.run');
}
function test06($cache)
{
    echo "Testing scope...";
    $tmpl = new Scurvy('06_scope.html', './', $cache);
    $tmpl->set('a', array(array('b' => 'first'), array('b' => 'second'), array('b' => 'third'), array('b' => 'fourth')));
    $tmpl->set('b', 'rumplestiltskin');
    $output = $tmpl->render();
    file_put_contents('06_scope.run', $output);
    return getDiff('06_scope.out', '06_scope.run');
}
$cache = false;
//if (in_array('-cache', $argv)) $cache = true;
// Run our tests.
$time = microtime();
runTest('test01', $cache);
runTest('test02', $cache);
runTest('test03', $cache);
runTest('test04', $cache);
runTest('test05', $cache);
runTest('test06', $cache);
$time = microtime() - $time;
echo "Running time: {$time}\n";
Exemple #23
0
<?php

require_once 'test_base.inc';
function headerTestController($serverPort)
{
    $args = array('Authorization' => 'foo');
    var_dump(request(php_uname('n'), $serverPort, "test_headers.php", $args));
}
runTest('headerTest', "headerTestController");
/**
 *
 */
function createPlatform($server_url, $cfg, &$args4call)
{
    $method = __FUNCTION__;
    $platforms = array();
    $item = new stdClass();
    $item->name = 'PLAT-01';
    $item->notes = 'Notes for' . $item->name;
    $platforms[] = $item;
    $item = new stdClass();
    $item->name = 'PLAT-02';
    $item->notes = 'Notes for' . $item->name;
    $platforms[] = $item;
    $item = new stdClass();
    $item->name = 'PLAT-03';
    $item->notes = 'Notes for' . $item->name;
    $platforms[] = $item;
    $res = array();
    $client = new IXR_Client($server_url);
    foreach ($platforms as $item) {
        $args4call[$method] = array("devKey" => $cfg->devKey, "platformname" => $item->name, "notes" => $item->notes, "testprojectname" => $args4call['createTestProject']["testprojectname"]);
        $client->debug = $cfg->debug;
        $res[] = runTest($client, $method, $args4call[$method]);
    }
    return $res;
}
Exemple #25
0
<?php

/* MorgOS is a Content Management System written in PHP
 * Copyright (C) 2005-2007 MorgOS
 * This program is free software; you can redistribute it and/or modify 
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * any later version.
 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Library General Public License for more details.
 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
*/
/** \file core/tests/index.php
 * Suite for the tests
 *
 * @since 0.2
 * @since 0.3 complete rewrite
 * @author Nathan Samson
*/
include_once 'compwrapper.class.php';
runTest('MorgOSLoader', 'core/tests/runtests.5.php', 'core/tests/base.php');
function createPlatform($server_url, $cfg, &$args4call, $item)
{
    $method = 'createPlatform';
    $args4call[$method] = array("devKey" => $cfg->devKey, "platformname" => $item->name, "notes" => $item->notes, "testprojectname" => $args4call['createTestProject']["testprojectname"]);
    $client = new IXR_Client($server_url);
    $client->debug = $cfg->debug;
    return runTest($client, $method, $args4call[$method]);
}
<?php

/**
 * TestLink Open Source Project - http://testlink.sourceforge.net/
 * This script is distributed under the GNU General Public License 2 or later.
 *
 * @Author		francisco.mancardi@gmail.com
 *
 */
require_once 'util.php';
require_once 'sample.inc.php';
show_api_db_sample_msg();
$method = 'getTestCasesForTestPlan';
$test_num = 1;
$unitTestDescription = "Test {$test_num} - {$method}";
$tplan_id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 713;
$args = array();
$args["devKey"] = '21232f297a57a5a743894a0e4a801fc3';
$args["testplanid"] = $tplan_id;
$args["testcase"] = 709;
$additionalInfo = '';
$debug = true;
echo $unitTestDescription;
echo $additionalInfo;
$client = new IXR_Client($server_url);
$client->debug = $debug;
$answer = runTest($client, $method, $args, $test_num);
function tc_sushi(&$client, &$tcCounter)
{
    $method = 'createTestCase';
    $unitTestDescription = "Test #{$tcCounter}- {$method} - Test Case OK - Sushi Rice recipe";
    $tcCounter++;
    $args = array();
    $args["devKey"] = DEV_KEY;
    $args["testprojectid"] = 378;
    $args["testsuiteid"] = 379;
    $args["testcasename"] = 'Sushi Rice recipe';
    $args["summary"] = "When making authentic sushi, it is important to first create authentic sushi rice " . " -- it is, after all, the base flavor and texture of the rolls you create. " . " While it may seem difficult to make this recipe for the first time, " . " it is well worth perfecting. " . " It adds sweet, tangy flavor to sushi rolls, and the sticky texture is necessary " . " to hold the rolls together. Use this rice whenever cooked sushi rice is called for.";
    $args["prerequisites"] = "3 cups uncooked sushi or sticky rice<br/>" . "3 cups water<br/>" . "1/2 cup rice vinegar<br/>" . "1/2cup sugar<br/>" . "1 teaspoon salt";
    $args["authorlogin"] = '******';
    $debug = true;
    echo $unitTestDescription;
    $client->debug = $debug;
    runTest($client, $method, $args);
}
 * @modified $Date: 2009/05/01 20:36:56 $ by $Author: franciscom $
 * @Author: francisco.mancardi@gmail.com
 *
 * rev: 
 */
require_once 'util.php';
require_once 'sample.inc.php';
show_api_db_sample_msg();
// -------------------------------------------------------------------------------------
$method = 'getBuildsForTestPlan';
$unitTestDescription = "Test - {$method}";
$args = array();
$args["devKey"] = DEV_KEY;
$args["testplanid"] = 3;
$debug = true;
echo $unitTestDescription;
$client = new IXR_Client($server_url);
$client->debug = $debug;
runTest($client, $method, $args);
// -------------------------------------------------------------------------------------
$method = 'getLatestBuildForTestPlan';
$unitTestDescription = "Test - {$method}";
$args = array();
$args["devKey"] = DEV_KEY;
$args["testplanid"] = 3;
$debug = true;
echo $unitTestDescription;
$client = new IXR_Client($server_url);
$client->debug = $debug;
runTest($client, $method, $args);
Exemple #30
0
 *
 */
// don't want the output to be cached by the browser
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Sat, 06 Dec 1988 05:00:00 GMT");
// RECAPTCHA SUPPORT SOON, leave these empty. They won't work :)
// enter keys for your domain from recaptcha.net, if you're so inclined
// not a huge deal if this is going to be kept private
$recaptcha_publickey = '';
$recaptcha_privatekey = '';
// very necessary
require_once 'SecretSantaBot.php';
// check the mode, do different things depending on whether or not it's set to 'test' or 'email'
if (isset($_POST)) {
    if ($_POST['mode'] == 'try') {
        runTest();
    } elseif ($_POST['mode'] == 'email-confirm') {
        confirmBeforeSending($recaptcha_publickey, $recaptcha_privatekey);
    } elseif ($_POST['mode'] == 'email') {
        runEmail();
    } else {
        echo '<p class="error">Unexpected mode.</p>';
    }
}
/** 
 * No longer gross!
 * Takes the name[] array and gets the values, along with getting the email[] values :)
 */
function prepPeopleArray()
{
    $people = array();