/** * testを実行する * -test クラス名 * option: * -m メソッド名 * -m メソッド名 -b ブロック名 * -fail failを表示する * -succes succesを表示する * -none noneを表示する * @summary execute test */ public static function __setup_test__(Request $req, $value) { $level = ($req->is_vars('fail') ? Test::FAIL : 0) | ($req->is_vars('success') ? Test::SUCCESS : 0) | ($req->is_vars('none') ? Test::NONE : 0); if ($level === 0) { $level = Test::FAIL | Test::SUCCESS | Test::NONE; } Test::exec_type($level | Test::COUNT); if (empty($value)) { Test::verifies(); } else { Test::verify($value, $req->in_vars("m"), $req->in_vars("b")); } Test::flush(); }
<?php include_once dirname(__FILE__) . "/__settings__.php"; application_settings(__FILE__, null, dirname(dirname(__FILE__))); import("core.Log"); import("core.Flow"); import("core.File"); import("ext.Test"); import("ext.Setup"); header_output_text(); $flow = new Flow(); if ($flow->isVars("class")) { test($flow->inVars("class"), $flow->inVars("method"), $flow->inVars("block")); } else { if (!$flow->isVars("full")) { Test::exec_type(Test::FAIL); } tests(root_path()); }
/** * 表示種類の定義 * @param int $type Test::NONE Test::FAIL Test::SUCCESSによる論理和 */ public static final function exec_type($type) { self::$exec_type = decbin($type); }