本文整理汇总了PHP中SapphireTest::use_test_manifest方法的典型用法代码示例。如果您正苦于以下问题:PHP SapphireTest::use_test_manifest方法的具体用法?PHP SapphireTest::use_test_manifest怎么用?PHP SapphireTest::use_test_manifest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SapphireTest
的用法示例。
在下文中一共展示了SapphireTest::use_test_manifest方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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';
if (class_exists('TestRunner')) {
// 3.x compat
\TestRunner::use_test_manifest();
} else {
\SapphireTest::use_test_manifest();
}
unset($_GET['flush']);
// Remove the error handler so that PHPUnit can add its own
restore_error_handler();
}
示例2: array
$_GET = array();
}
if (!isset($_REQUEST)) {
$_REQUEST = array();
}
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;
// Fake a session
$_SESSION = null;
// Prepare manifest autoloader
$controller = new FakeController();
SapphireTest::use_test_manifest();
SapphireTest::set_is_running_test(true);
// Remove the error handler so that PHPUnit can add its own
restore_error_handler();