/** * 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); } } } }
<?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();
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(); } } } } }