public static function addSuite($desc, $fn) { if (self::$suiteDepth > 0) { $self = new SelfObject(self::getCurrentSuite()->getSelfObject()); } else { $self = new SelfObject(); } $suite = new TestSuite($desc, $self); Spec::pushSuite($suite); $fn($self); Spec::popSuite(); }
function it($should, $fn) { $suite = Spec::getCurrentSuite(); $test = new Test($suite, $should, $fn); $suite->addTest($test); }
}); /** * Runs PSpec tests * * @dependsOn test:init */ task('test:spec', function ($req) { $result = Spec::run('test/spec', array('verbose' => isset($req['verbose']), 'taskname' => 'test:spec')); }); /** * Runs PSpec "integration" tests - might take a while * * @dependsOn test:init */ task('test:integration', function ($req) { return Spec::run('test/integration', array('verbose' => isset($req['verbose']), 'taskname' => 'test:integration')); }); /** * Test all * @dependsOn test:unit, test:spec */ task('test'); // config /** * Configures pantr to create a local pear package * * @needsRequest * @hidden */ task('config:deploy-local', function ($req) { if (isset($req['l'])) {