public function finalSetup() { parent::finalSetup(); // Inject test autoloader self::requireTestsAutoloader(); TestSetup::applyInitialConfig(); }
<?php // $Id: $ set_include_path('../libs:libs'); include_once 'simpletest/unit_tester.php'; include_once 'simpletest/reporter.php'; include_once '../ar5_base.php'; include_once 'mock/configurator.php'; include_once 'mock/driver.php'; // include_once('context/configurator/XMLConfigurator.php'); include_once 'active/record/drivers/sqlite/sqlite.php'; include_once 'active/record/Base.php'; $config = new MockConfigurator(); class TestSetup extends UnitTestCase { function testTrue() { } } $test = new TestSetup(); $test->run(new TextReporter());
<?php // Here you can initialize variables that will be available to your tests TestSetup::init(); class TestSetup { /** * Initializes the test setup. * @return null */ public static function init() { /** * Delete phantomJS screenshots. */ $phantomJsRecords = glob('tests/_output/record*'); if (!empty($phantomJsRecords)) { self::rrmdir('tests/_output/'); mkdir('tests/_output/'); } } /** * Delete folder contents recursively. */ private static function rrmdir($dir) { if (is_dir($dir)) { $objects = scandir($dir); foreach ($objects as $object) { if ($object != "." && $object != "..") { if (filetype($dir . "/" . $object) == "dir") {
function finalSetup() { self::requireTestsAutoloader(); TestSetup::applyInitialConfig(); }