本文整理汇总了PHP中TestManager::runGroupTest方法的典型用法代码示例。如果您正苦于以下问题:PHP TestManager::runGroupTest方法的具体用法?PHP TestManager::runGroupTest怎么用?PHP TestManager::runGroupTest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestManager
的用法示例。
在下文中一共展示了TestManager::runGroupTest方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CakePHPTestHeader
$baseUrl = BASE;
include CAKE . 'tests' . DS . 'lib' . DS . 'footer.php';
break;
}
}
CakePHPTestHeader();
CakePHPTestSuiteHeader();
define('RUN_TEST_LINK', $_SERVER['PHP_SELF']);
if (isset($_GET['group'])) {
if ('all' == $_GET['group']) {
TestManager::runAllTests(CakeTestsGetReporter());
} else {
if (isset($_GET['app'])) {
TestManager::runGroupTest(ucfirst($_GET['group']), APP_TEST_GROUPS, CakeTestsGetReporter());
} else {
TestManager::runGroupTest(ucfirst($_GET['group']), CORE_TEST_GROUPS, CakeTestsGetReporter());
}
}
CakePHPTestRunMore();
CakePHPTestSuiteFooter();
exit;
}
if (isset($_GET['case'])) {
TestManager::runTestCase($_GET['case'], CakeTestsGetReporter());
CakePHPTestRunMore();
CakePHPTestSuiteFooter();
exit;
}
if (isset($_GET['show']) && $_GET['show'] == 'cases') {
CakePHPTestCaseList();
} else {
示例2: CakePHPTestSuiteFooter
include CAKE_TESTS_LIB . 'xdebug.php';
CakePHPTestSuiteFooter();
exit;
}
}
CakePHPTestHeader();
CakePHPTestSuiteHeader();
define('RUN_TEST_LINK', $_SERVER['PHP_SELF']);
if (isset($_GET['group'])) {
if ('all' == $_GET['group']) {
TestManager::runAllTests(CakeTestsGetReporter());
} else {
if ($analyzeCodeCoverage) {
CodeCoverageManager::start($_GET['group'], CakeTestsGetReporter());
}
TestManager::runGroupTest(ucfirst($_GET['group']), CakeTestsGetReporter());
if ($analyzeCodeCoverage) {
CodeCoverageManager::report();
}
}
CakePHPTestRunMore();
CakePHPTestAnalyzeCodeCoverage();
} elseif (isset($_GET['case'])) {
if ($analyzeCodeCoverage) {
CodeCoverageManager::start($_GET['case'], CakeTestsGetReporter());
}
TestManager::runTestCase($_GET['case'], CakeTestsGetReporter());
if ($analyzeCodeCoverage) {
CodeCoverageManager::report();
}
CakePHPTestRunMore();
示例3: ob_start
***********************************************************************************/
ob_start();
require_once LIMB_DIR . '/tests/lib/test_utils.php';
require_once LIMB_DIR . '/tests/lib/test_manager.php';
if (!(include_once SIMPLE_TEST . 'reporter.php')) {
error('runtime', 'LIBRARY_REQUIRED', array('library' => 'Simple Test', 'path' => SIMPLE_TEST));
}
if (isset($_GET['all'])) {
TestManager::runAllTests($_GET['all'], new HTMLReporter());
echo "<p><a href='" . $_SERVER['PHP_SELF'] . "'>Run more tests</a></p>";
echo debug::parse_html_console();
ob_end_flush();
exit(0);
}
if (isset($_GET['group'])) {
TestManager::runGroupTest(ucfirst($_GET['group']), $_GET['group'], new HTMLReporter());
echo "<p><a href='" . $_SERVER['PHP_SELF'] . "'>Run more tests</a></p>";
echo debug::parse_html_console();
ob_end_flush();
exit(0);
}
if (isset($_GET['case'])) {
TestManager::runTestCase($_GET['case'], new HTMLReporter());
echo "<p><a href='" . $_SERVER['PHP_SELF'] . "?show=cases'>Run more tests</a></p>";
echo debug::parse_html_console();
ob_end_flush();
exit(0);
}
echo "<h1>Unit Test Suite</h1>\n";
echo "<p><a href='" . $_SERVER['PHP_SELF'] . "'>Test groups</a>";
echo " || <a href='" . $_SERVER['PHP_SELF'] . "?show=cases'>Test cases</a></p>";
示例4: __run
/**
* Executes the tests depending on our settings
*
* @return void
* @access private
*/
function __run()
{
$reporter = new CLIReporter();
$this->__setGetVars();
if ($this->type == 'all') {
return TestManager::runAllTests($reporter);
}
if ($this->doCoverage) {
if (!extension_loaded('xdebug')) {
$this->out('You must install Xdebug to use the CakePHP(tm) Code Coverage Analyzation. Download it from http://www.xdebug.org/docs/install');
exit(0);
}
}
if ($this->type == 'group') {
$ucFirstGroup = ucfirst($this->file);
$path = CORE_TEST_GROUPS;
if ($this->category == 'app') {
$path = APP_TEST_GROUPS;
} elseif ($this->isPluginTest) {
$path = APP . 'plugins' . DS . $this->category . DS . 'tests' . DS . 'groups';
}
if ($this->doCoverage) {
require_once CAKE . 'tests' . DS . 'lib' . DS . 'code_coverage_manager.php';
CodeCoverageManager::start($ucFirstGroup, $reporter);
}
$result = TestManager::runGroupTest($ucFirstGroup, $reporter);
if ($this->doCoverage) {
CodeCoverageManager::report();
}
return $result;
}
$case = 'libs' . DS . $this->file . '.test.php';
if ($this->category == 'app') {
$case = $this->file . '.test.php';
} elseif ($this->isPluginTest) {
$case = $this->file . '.test.php';
}
if ($this->doCoverage) {
require_once CAKE . 'tests' . DS . 'lib' . DS . 'code_coverage_manager.php';
CodeCoverageManager::start($case, $reporter);
}
$result = TestManager::runTestCase($case, $reporter);
if ($this->doCoverage) {
CodeCoverageManager::report();
}
return $result;
}
示例5: _runTest
/**
* Executes the tests depending on $testToRun
*/
function _runTest()
{
// Need to set some get variables as TestManager depends on them
if (in_array($this->testToRun['section'], $this->plugins)) {
$_GET['plugin'] = $this->testToRun['section'];
} elseif (in_array(Inflector::Humanize($this->testToRun['section']), $this->plugins)) {
$_GET['plugin'] = Inflector::Humanize($this->testToRun['section']);
} elseif ($this->testToRun['section'] == 'app') {
$_GET['app'] = true;
}
if ($this->testToRun['area'] == 'all') {
TestManager::runAllTests(new TextReporter());
return;
} elseif ($this->testToRun['area'] == 'group') {
$_GET['group'] == $this->testToRun['file'];
if (isset($_GET['app'])) {
TestManager::runGroupTest(ucfirst($_GET['group']), APP_TEST_GROUPS, new TextReporter());
} elseif (isset($_GET['plugin'])) {
TestManager::runGroupTest(ucfirst($_GET['group']), APP . 'plugins' . DS . $_GET['plugin'] . DS . 'tests' . DS . 'groups', new TextReporter());
} else {
TestManager::runGroupTest(ucfirst($_GET['group']), CORE_TEST_GROUPS, new TextReporter());
}
return;
} else {
$_GET['case'] = 'cases' . DS . $this->testToRun['type'] . DS . $this->testToRun['file'] . '.test.php';
TestManager::runTestCase($_GET['case'], new TextReporter());
return;
}
}
示例6: ini_set
/**
* Short Description
*
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @copyright Copyright 2008-2009, Spaghetti* Framework (http://spaghettiphp.org/)
*
*/
if (version_compare(PHP_VERSION, "5.3") >= 0) {
ini_set("error_reporting", E_ALL & ~E_DEPRECATED);
} else {
ini_set("error_reporting", E_ALL);
}
define("DS", DIRECTORY_SEPARATOR);
define("ROOT", dirname(dirname(dirname(__FILE__))));
define("BASE_URL", "http://" . $_SERVER["HTTP_HOST"]);
define("CORE", ROOT . DS . "core");
define("LIB", CORE . DS . "lib");
define("APP", ROOT . DS . "app");
$self = dirname($_SERVER["PHP_SELF"]);
while (in_array(basename($self), array("app", "core", "tests", "webroot"))) {
$self = dirname($self);
}
define("WEBROOT", $self);
include "../../core/bootstrap.php";
App::import("Core", "test_manager");
TestManager::loadTestFramework();
if (isset($_GET["case"])) {
TestManager::runTestCase($_GET["case"]);
} elseif (isset($_GET["group"])) {
TestManager::runGroupTest($_GET["group"]);
}
示例7: error
}
break;
}
}
}
if (!@(include_once SIMPLE_TEST . 'runner.php')) {
error('runtime', 'LIBRARY_REQUIRED', array('library' => 'Simple Test', 'path' => SIMPLE_TEST));
}
require_once LIMB_DIR . '/tests/lib/cli_reporter.php';
/* list grouptests */
if ($opt_list) {
echo CLITestManager::getGroupTestList(TEST_GROUPS_DIR);
echo CLITestManager::getTestCaseList(TEST_CASES_DIR);
exit(0);
}
/* run a test case */
if ($opt_casefile) {
TestManager::runTestCase($opt_casefile, new CLIReporter($opt_separator));
echo debug::parse_cli_console();
exit(0);
}
/* run a grouptest */
if ($opt_groupfile) {
TestManager::runGroupTest($opt_groupfile, TEST_GROUPS_DIR, new CLIReporter($opt_separator));
echo debug::parse_cli_console();
exit(0);
}
/* run all tests */
TestManager::runAllTests(new CLIReporter($opt_separator));
echo debug::parse_cli_console();
exit(0);
示例8: DW_TESTS_GetReporter
default:
$footer = <<<EOD
</body>
</html>
EOD;
echo $footer;
break;
}
}
/** OUTPUT STARTS HERE **/
// If it's a group test
if (isset($_GET['group'])) {
if ('all' == $_GET['group']) {
TestManager::runAllTests(DW_TESTS_GetReporter());
} else {
TestManager::runGroupTest(ucfirst($_GET['group']), TEST_GROUPS, DW_TESTS_GetReporter());
}
DW_TESTS_PaintRunMore();
exit;
}
// If it's a single test case
if (isset($_GET['case'])) {
TestManager::runTestCase($_GET['case'], TEST_CASES, DW_TESTS_GetReporter());
DW_TESTS_PaintRunMore();
exit;
}
// Else it's the main page
DW_TESTS_PaintHeader();
DW_TESTS_PaintSuiteHeader();
if (isset($_GET['show']) && $_GET['show'] == 'cases') {
DW_TESTS_PaintCaseList();
示例9: DW_TESTS_GetReporter
// If it's a group test
if (isset($_GET['group'])) {
if ('all' == $_GET['group']) {
TestManager::runAllTests(DW_TESTS_GetReporter());
} else {
TestManager::runGroupTest(ucfirst($_GET['group']), TEST_GROUPS, DW_TESTS_GetReporter());
}
DW_TESTS_PaintRunMore();
exit;
}
// If it's a plugin group test
if (isset($_GET['plugin_group'])) {
if ('all' == $_GET['plugin_group']) {
TestManager::runAllPluginTests(DW_TESTS_GetReporter());
} else {
TestManager::runGroupTest(ucfirst($_GET['plugin_group']), TEST_PLUGINS, DW_TESTS_GetReporter());
}
DW_TESTS_PaintRunMore();
exit;
}
// If it's a single test case
if (isset($_GET['case'])) {
TestManager::runTestCase($_GET['case'], TEST_CASES, DW_TESTS_GetReporter());
DW_TESTS_PaintRunMore();
exit;
}
// If it's a single plugin test case
if (isset($_GET['plugin_case'])) {
TestManager::runTestCase($_GET['plugin_case'], TEST_PLUGINS, DW_TESTS_GetReporter());
DW_TESTS_PaintRunMore();
exit;
示例10: CLIReporter
}
/* run a test case */
if ($opt_casefile) {
TestManager::runTestFile($opt_casefile, new CLIReporter($opt_separator));
exit(0);
}
/* run a test case by id */
if ($opt_caseid) {
TestManager::runTestCase($opt_caseid, TEST_CASES, new CLIReporter($opt_separator));
exit(0);
}
/* run a plugin test by case id */
if ($opt_plugincaseid) {
TestManager::runTestCase($opt_plugincaseid, TEST_PLUGINS, new CLIReporter($opt_separator));
exit(0);
}
/* run a grouptest */
if ($opt_groupfile) {
TestManager::runGroupTest($opt_groupfile, TEST_GROUPS, new CLIReporter($opt_separator));
exit(0);
}
/* run a plugin grouptest */
if ($opt_plugingroupfile) {
TestManager::runGroupTest($opt_plugingroupfile, TEST_PLUGINS, new CLIReporter($opt_separator));
exit(0);
}
/* run a plugin group test */
//FIXME
/* run all tests */
TestManager::runAllTests(new CLIReporter($opt_separator));
exit(0);