Exemplo n.º 1
0
Arquivo: index.php Projeto: extend/wee
	test('set values', function() {batch(3, 'session/set.php');});
	test('clear', function() {batch(4, 'session/clear.php');});

	module('Session (storage: database table)');
	test('set values', function() {batch(4, 'session/dbtableset.php');});
	test('clear', function() {batch(5, 'session/dbtableclear.php');});

	module('CLI');
<?php 
define('ALLOW_INCLUSION', 1);
define('ROOT_PATH', '../../');
require ROOT_PATH . 'wee/wee.php';
// Clean up the tmp directory
exec('rm -rf ' . ROOT_PATH . 'app/tmp/*');
// Run the test suite
$o = new weeTestSuite('../tests/');
$aTests = $o->toArray();
unset($aTests[getcwd() . '/../tests/maketests.php']);
$aTests = array_keys($aTests);
foreach ($aTests as $i => $sPath) {
    ?>
	test('<?php 
    echo substr($sPath, strlen(getcwd() . '/../tests/'));
    ?>
', function() {run('cli.php?t=<?php 
    echo $i;
    ?>
');});
<?php 
}
?>
Exemplo n.º 2
0
	Copyright (c) 2006-2010 Dev:Extend

	This library is free software; you can redistribute it and/or
	modify it under the terms of the GNU Lesser General Public
	License as published by the Free Software Foundation; either
	version 2.1 of the License, or (at your option) any later version.

	This library 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
	Lesser General Public License for more details.

	You should have received a copy of the GNU Lesser General Public
	License along with this library; if not, write to the Free Software
	Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
*/
$aOptions = getopt('cf:');
$aOptions === false and die("getopt failed to get the options from the command line.\n");
if (!isset($aOptions['f'])) {
    echo "usage: php maketests.php [-c] -f tests_path\n";
    return -1;
}
if (isset($aOptions['c'])) {
    define('WEE_CODE_COVERAGE', 1);
}
// define('DEBUG', 1);
define('ALLOW_INCLUSION', 1);
require 'wee/wee.php';
$o = new weeTestSuite($aOptions['f']);
$o->run();
echo $o->toString();