<?php require dirname(__FILE__) . '/vendor/ztest/ztest.php'; require dirname(__FILE__) . '/helpers-5.3.php'; set_time_limit(0); $suite = new ztest\TestSuite("php-helpers test suite"); $suite->require_all('test'); $suite->auto_fill(); $reporter = new ztest\ConsoleReporter(); $reporter->enable_color(); $suite->run($reporter);
<?php // Adjust this to point to the ztest library // (relative to the current working directory) require 'ztest/ztest.php'; require 'lib/phpx.php'; phpx\PHPX::init(); // Create test suite $suite = new ztest\TestSuite("phpx test suite"); // Recursively scan the 'test' directory and require() all PHP source files // Again, 'test' is relative to the current working directory. $suite->require_all('test'); // Add non-abstract subclasses of ztest\TestCase as test-cases to be run $suite->auto_fill(); // And away we go. $suite->run(new ztest\ConsoleReporter()); function parse_and_eval($file) { $parser = new phpx\Parser(); $class = $parser->parse(file_get_contents($file)); $class->finalise_classes(); phpx\Library::register_file($class); $source = $class->to_php(); eval('?>' . $source); }
<?php require_once __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'curl.php'; require_once 'ztest/ztest.php'; require_once 'test_helper.php'; $reporter = new ztest\ConsoleReporter(); $reporter->enable_color(); $suite = new ztest\TestSuite('Curl and CurlResponse unit tests'); $suite->require_all(__DIR__ . DIRECTORY_SEPARATOR . 'unit'); $suite->auto_fill(); $suite->run($reporter);
<?php require dirname(__FILE__) . '/../ztest.php'; $suite = new ztest\TestSuite("ztest example test suite"); echo "NOTE: Passed assertions for this suite will be less than total.\n** This is OK (as long as there are no 'F's) **\n\n"; $suite->require_all(dirname(__FILE__) . '/test'); $suite->auto_fill(); $reporter = new ztest\ConsoleReporter(); $reporter->enable_color(); $suite->run($reporter);