本文整理汇总了PHP中Test::init方法的典型用法代码示例。如果您正苦于以下问题:PHP Test::init方法的具体用法?PHP Test::init怎么用?PHP Test::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Test
的用法示例。
在下文中一共展示了Test::init方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadTests
/**
* Load the Codeception tests from disk.
*/
public function loadTests()
{
if (!isset($this->config['tests'])) {
return;
}
foreach ($this->config['tests'] as $type => $active) {
// If the test type has been disabled in the Webception config,
// skip processing the directory read for those tests.
if (!$active) {
break;
}
// if test folder is not exitst skipping
if (!file_exists($this->config['paths']['tests'] . $this->config['DS'] . $type)) {
continue;
}
$files = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator("{$this->config['paths']['tests']}" . $this->config['DS'] . "{$type}" . $this->config['DS'], \FilesystemIterator::SKIP_DOTS), \RecursiveIteratorIterator::SELF_FIRST);
// Iterate through all the files, and filter out
// any files that are in the ignore list.
foreach ($files as $file) {
if (!isset($this->config['ignore'][$type]) || !in_array($file->getFilename(), $this->config['ignore'][$type]) && $file->isFile()) {
// Declare a new test and add it to the list.
$test = new Test();
$test->init($type, $file);
$this->addTest($test);
unset($test);
}
}
}
}
示例2: init
<?php
/**
* Test Script init file
* User: winglechen
* Date: 15/10/22
* Time: 15:26
*/
namespace Zan\Framework;
require __DIR__ . '/../vendor/autoload.php';
require __DIR__ . '/Zan.php';
class Test
{
public static function init()
{
}
}
Test::init();
示例3: run
public static function run()
{
if (isset($_GET['mode'])) {
$mode = $_GET['mode'];
} else {
$mode = "";
}
$request = True;
//najskôr vyriadime požiadavku
if ($mode == self::MODE_LOGIN && isset($_POST['password'])) {
Auth::login($_POST['password']);
} else {
if ($mode == self::MODE_SUBMIT_TEST) {
if (Auth::isAuth()) {
Test::submit();
} else {
Viewer::addMessage("Na túto akciu nemáš prístup !", Viewer::ERROR);
}
} else {
if ($mode == self::MODE_LOGOUT) {
if (Auth::isAuth()) {
Auth::logout();
} else {
Viewer::addMessage("Na túto akciu nemáš prístup !", Viewer::ERROR);
}
} else {
if ($mode == self::MODE_DEL_PREDMET) {
if (Auth::isAdmin()) {
Admin::delPredmet();
} else {
Viewer::addMessage("Na túto akciu nemáš prístup !", Viewer::ERROR);
}
} else {
if ($mode == self::MODE_ADD_CLASS) {
if (Auth::isAdmin()) {
Admin::addClass();
} else {
Viewer::addMessage("Na túto akciu nemáš prístup !", Viewer::ERROR);
}
} else {
if ($mode == self::MODE_DEL_CLASS) {
if (Auth::isAdmin()) {
Admin::delClass();
} else {
Viewer::addMessage("Na túto akciu nemáš prístup !", Viewer::ERROR);
}
} else {
if ($mode == self::MODE_ADD_PREDMET) {
if (Auth::isAuth()) {
Admin::addPredmet();
} else {
Viewer::addMessage("Na túto akciu nemáš prístup !", Viewer::ERROR);
}
}
}
}
}
}
}
}
//a idem spracovť stránku
//ak som prihlásený a chcem sa znova prihlásiť tak mi to nepojde
if (self::$page == self::LOGIN && Auth::isAuth()) {
Viewer::setPage(self::TEST_LIST);
}
if (self::$page == self::TEST_LIST) {
TestList::init();
} else {
if (self::$page == self::TEST) {
Test::init();
} else {
if (self::$page == self::STATS) {
Stats::init();
} else {
if (self::$page == self::ADMIN) {
Admin::init();
}
}
}
}
}