I have used PHPSpec succesfully but it's not actively developed now is it? It's great but don't think I would go with a stalled project. Anyway to the point I used the following setup to run the tests from the webbrowser, maybe you'll find something to help you to set it up for CLI.
PHPSpecConfiguration.php
$projectDir = realpath( dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' ) . DIRECTORY_SEPARATOR;
$simdal_root = $projectDir . 'library';
$phpspec_root = $projectDir . '..' . DIRECTORY_SEPARATOR . 'PHPSpec';
$mockery_root = $projectDir . '..' . DIRECTORY_SEPARATOR . 'Mockery';
$paths = array(
'SimDAL'=>$simdal_root,
'PHPSpec'=>$phpspec_root,
'Mockery'=>$mockery_root
);
set_include_path( implode( PATH_SEPARATOR, $paths ) . PATH_SEPARATOR . get_include_path() );
require_once 'PHPSpec.php';
require_once 'Mockery/Framework.php';
class Custom_Autoload
{
public static function autoload($class)
{
//$path = dirname(dirname(__FILE__));
//include $path . '/' . str_replace('_', '/', $class) . '.php';
if (preg_match('/^([^ _]*)?(_[^ _]*)*$/', $class, $matches)) {
include str_replace('_', '/', $class) . '.php';
return true;
}
return false;
}
}
spl_autoload_register(array('Custom_Autoload', 'autoload'));
and then the file that runs it all: AllSpecs.php;
require_once 'PHPSpecTestConfiguration.php';
$options = new stdClass();
$options->recursive = true;
$options->specdocs = true;
$options->reporter = 'html';
PHPSpec_Runner::run($options);
I don't like CLI testing...But this might help someone.