本文整理匯總了PHP中TestRunner::use_test_manifest方法的典型用法代碼示例。如果您正苦於以下問題:PHP TestRunner::use_test_manifest方法的具體用法?PHP TestRunner::use_test_manifest怎麽用?PHP TestRunner::use_test_manifest使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TestRunner
的用法示例。
在下文中一共展示了TestRunner::use_test_manifest方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: init
function init()
{
parent::init();
if (!Permission::check('ADMIN')) {
return Security::permissionFailure();
}
TestRunner::use_test_manifest();
}
示例2: process
/**
* Loads kernel file.
*
* @param ContainerBuilder $container
*/
public function process(ContainerBuilder $container)
{
// Connect to database and build manifest
$frameworkPath = $container->getParameter('behat.silverstripe_extension.framework_path');
$_GET['flush'] = 1;
require_once $frameworkPath . '/core/Core.php';
\TestRunner::use_test_manifest();
unset($_GET['flush']);
// Remove the error handler so that PHPUnit can add its own
restore_error_handler();
}
示例3: foreach
}
foreach ($args as $arg) {
if (strpos($arg, '=') == false) {
$_GET['args'][] = $arg;
} else {
$newItems = array();
parse_str(substr($arg, 0, 2) == '--' ? substr($arg, 2) : $arg, $newItems);
$_GET = array_merge($_GET, $newItems);
}
}
$_REQUEST = array_merge($_REQUEST, $_GET);
}
// Connect to database
require_once $frameworkPath . '/core/Core.php';
require_once $frameworkPath . '/tests/FakeController.php';
global $databaseConfig;
DB::connect($databaseConfig);
// Now set a fake REQUEST_URI
$_SERVER['REQUEST_URI'] = BASE_URL . '/dev';
// Fake a session
$_SESSION = null;
// Prepare manifest autoloader
$controller = new FakeController();
// Get test manifest
TestRunner::use_test_manifest();
SapphireTest::set_is_running_test(true);
// Remove the error handler so that PHPUnit can add its own
restore_error_handler();
if (!isset($_GET['flush']) || !$_GET['flush']) {
Debug::message("WARNING: Manifest not flushed. " . "Add flush=1 as an argument to discover new classes or files.\n", false);
}