当前位置: 首页>>代码示例>>PHP>>正文


PHP TestManager::runTestCase方法代码示例

本文整理汇总了PHP中TestManager::runTestCase方法的典型用法代码示例。如果您正苦于以下问题:PHP TestManager::runTestCase方法的具体用法?PHP TestManager::runTestCase怎么用?PHP TestManager::runTestCase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TestManager的用法示例。


在下文中一共展示了TestManager::runTestCase方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: CakePHPTestHeader

    }
}
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 {
    CakePHPTestGroupTestList();
}
CakePHPTestSuiteFooter();
开发者ID:rhencke,项目名称:mozilla-cvs-history,代码行数:31,代码来源:test.php

示例2: _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;
     }
 }
开发者ID:kaz0636,项目名称:openflp,代码行数:32,代码来源:testsuite.php

示例3: HTMLReporter

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>";
if (isset($_GET['show']) && $_GET['show'] == 'cases') {
    echo HTMLTestManager::getGroupTestList(LIMB_DIR . '/tests/cases');
    echo HTMLTestManager::getGroupTestList(PROJECT_DIR . '/tests/cases');
} else {
    /* no group specified, so list them all */
    echo HTMLTestManager::getGroupTestList(LIMB_DIR . '/tests/groups');
    echo HTMLTestManager::getGroupTestList(PROJECT_DIR . '/tests/groups');
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:31,代码来源:index.php

示例4: 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"]);
}
开发者ID:vfeitoza,项目名称:spaghettiphp,代码行数:31,代码来源:test.php

示例5: __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;
 }
开发者ID:laiello,项目名称:myopensources,代码行数:53,代码来源:testsuite.php

示例6: 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);
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:31,代码来源:runtests.php

示例7: DW_TESTS_GetReporter

            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();
} else {
    /* no group specified, so list them all */
    DW_TESTS_PaintGroupTestList();
}
DW_TESTS_PaintFooter();
开发者ID:pyfun,项目名称:dokuwiki,代码行数:31,代码来源:index.php

示例8: exit

require_once 'lib/cli_reporter.php';
/* list grouptests */
if ($opt_grouplist) {
    echo CLITestManager::getGroupTestList(TEST_GROUPS);
}
/* list test cases */
if ($opt_caselist) {
    echo CLITestManager::getTestCaseList(TEST_CASES);
}
/* exit if we've displayed a list */
if ($opt_grouplist || $opt_caselist) {
    exit(0);
}
/* 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 grouptest */
if ($opt_groupfile) {
    TestManager::runGroupTest($opt_groupfile, TEST_GROUPS, new CLIReporter($opt_separator));
    exit(0);
}
/* run all tests */
TestManager::runAllTests(new CLIReporter($opt_separator));
exit(0);
开发者ID:pyfun,项目名称:dokuwiki,代码行数:31,代码来源:runtests.php

示例9: DW_TESTS_GetReporter

        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;
}
// Else it's the main page
DW_TESTS_PaintHeader();
DW_TESTS_PaintSuiteHeader();
if (isset($_GET['show']) && $_GET['show'] == 'cases') {
    DW_TESTS_PaintCaseList();
    DW_TESTS_PaintPluginTestCaseList();
} else {
    /* no group specified, so list them all */
    DW_TESTS_PaintGroupTestList();
    DW_TESTS_PaintPluginGroupTestList();
}
DW_TESTS_PaintFooter();
开发者ID:stretchyboy,项目名称:dokuwiki,代码行数:31,代码来源:index.php

示例10: exit

if ($opt_grouplist || $opt_caselist || $opt_plugincaselist || $opt_plugingrouplist) {
    exit(0);
}
/* 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 */
开发者ID:stretchyboy,项目名称:dokuwiki,代码行数:31,代码来源:runtests.php


注:本文中的TestManager::runTestCase方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。