/** * @covers Starter\routers\TraitStarterRouter::show_result */ public function test_show_result() { $method = new \ReflectionMethod($this->router, 'show_result'); $method->setAccessible(true); $response = new GetResponse(); $response->blocks['left'] = ''; $response->blocks['main'] = ''; $response->blocks['header'] = ''; ob_start(); \Starter::$current_router = AdminPanelRouter::class; $method->invoke($this->router, $response); \Starter::$current_router = SiteRouter::class; $method->invoke($this->router, $response); ob_end_clean(); self::assertNull(error_get_last()); }
<?php require_once 'config.php'; require_once 'libs/Starter.php'; require_once 'libs/Controller.php'; require_once 'libs/Model.php'; require_once 'libs/View.php'; // Library require_once 'libs/Database/Query.php'; require_once 'libs/Database/Database.php'; require_once 'libs/Database/Result.php'; require_once 'libs/Session.php'; require_once 'libs/Auth.php'; // Load the Starter! $starter = new Starter(); // Optional Path Settings //$bootstrap->setControllerPath(); //$bootstrap->setModelPath(); //$bootstrap->setDefaultFile(); //$bootstrap->setErrorFile(); $starter->init();
<?php require_once dirname(__FILE__) . '/main.inc.php'; Starter::standart_run('memberarea/logout', 'MemberAreaLogout');
<?php require_once dirname(__FILE__) . '/main.inc.php'; Starter::standart_run('memberarea/email', 'MemberAreaEmail');
<?php require_once dirname(__FILE__) . '/main.inc.php'; Starter::standart_run('main/balance', 'MainBalance');
<?php require_once dirname(__FILE__) . '/main.inc.php'; Starter::standart_run('admin/main', 'AdminMain');
<?php use common\classes\GetResponse; class SilentAdminPanelRouter extends \Starter\routers\AdminPanelRouter { public function __destruct() { } protected function show_result(GetResponse $response) { } } \Starter::$current_router = \Starter\routers\AdminPanelRouter::class; /** * Class AdminPanelRouterTest * */ class AdminPanelRouterTest extends PHPUnit_Framework_TestCase { /** * @var $router \Starter\routers\AdminPanelRouter */ private $router; public function setUp() { $this->router = new SilentAdminPanelRouter(); } /** * @covers \Starter\routers\AdminPanelRouter::__construct */ public function test_construct()
<?php require_once dirname(__FILE__) . '/main.inc.php'; Starter::standart_run('main/profile', 'MainProfile');
static function set_controller_class($controller_class) { self::$controller_class = $controller_class; }
<?php require_once dirname(__FILE__) . '/main.inc.php'; Starter::standart_run('main/userProfile', 'MainUserProfile');
<?php require_once dirname(__FILE__) . '/main.inc.php'; Starter::standart_run('memberarea/registration', 'MemberAreaRegistration');
<?php require_once dirname(__FILE__) . '/main.inc.php'; Starter::standart_run('main/autocomplete', 'AutoComplete');
<?php require_once dirname(__FILE__) . '/main.inc.php'; Starter::standart_run('main/index', 'MainIndex');
<?php require_once dirname(__FILE__) . '/main.inc.php'; Starter::standart_run('main/actions', 'Actions');