Example #1
0
<?php

require dirname(__FILE__) . '/../include/init.php';
$basedir = realpath(dirname(__FILE__) . '/..');
Bringit_ClassLoader::addIncludePath(array("{$basedir}/lib/simpletest", "{$basedir}/tests"));
if (in_array('--help', $argv)) {
    echo <<<EOM

CLI test runner for Bringit.

Available options:

  --with-internet    Include tests which run against live servers (generally http://example.org/).
  --with-reflector   Include tests which run against local HTTP reflector.
  --testfile <path>  Only run the specified test file.
  --help             This documentation.


EOM;
    exit(0);
}
require_once 'simpletest/unit_tester.php';
require_once 'simpletest/reporter.php';
/**
 * Return array of files matched, decending into subdirectories
 */
function globr($dir, $pattern)
{
    $dir = escapeshellcmd($dir);
    // list of all matching files currently in the directory.
    $files = glob("{$dir}/{$pattern}");
Example #2
0
File: init.php Project: pda/bringit
<?php

/**
 * Bringit init script.
 * Sets up include paths based on the directory this file is in.
 * Registers an SPL class autoload function.
 *
 * @author Paul Annesley
 * @package Bringit
 * @licence http://www.opensource.org/licenses/mit-license.php
 */
ini_set('display_errors', true);
error_reporting(E_ALL);
$basedir = realpath(dirname(__FILE__) . '/..');
require_once "{$basedir}/classes/Bringit/ClassLoader.php";
Bringit_ClassLoader::register();
Bringit_ClassLoader::addIncludePath(array("{$basedir}/classes", "{$basedir}/lib"));