当前位置: 首页>>代码示例>>PHP>>正文


PHP Test::testing方法代码示例

本文整理汇总了PHP中Test::testing方法的典型用法代码示例。如果您正苦于以下问题:PHP Test::testing方法的具体用法?PHP Test::testing怎么用?PHP Test::testing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Test的用法示例。


在下文中一共展示了Test::testing方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: redirect

 public function redirect()
 {
     if (isset($_SERVER['PATH_INFO'])) {
         $uri = $_SERVER['PATH_INFO'];
     } else {
         $uri = "";
     }
     if (isset($_SESSION["autorised"])) {
         $controller = null;
         switch ($uri) {
             case "/home":
                 include_once "/core/index.php";
                 $controller = new Home();
                 $controller->view();
                 break;
             case "/test":
             case "/test/start":
             case "/test/testing":
             case "/test/test_end":
                 include_once "/core/test.php";
                 $controller = new Test();
                 if ($uri == "/test") {
                     $controller->view();
                 }
                 if ($uri == "/test/start") {
                     $controller->start();
                 }
                 if ($uri == "/test/testing") {
                     $controller->testing();
                 }
                 if ($uri == "/test/test_end") {
                     $controller->test_end();
                 }
                 break;
             case "/result":
                 include_once "/core/result.php";
                 $controller = new Result();
                 $controller->view();
                 break;
             case "/add_test":
             case "/add_test/test":
             case "/add_test/question":
             case "/add_test/test/add":
             case "/add_test/question/add":
                 include_once "/core/add_test.php";
                 $controller = new Add_Test();
                 if ($uri == "/add_test") {
                     $controller->view();
                 }
                 if ($uri == "/add_test/test") {
                     $controller->new_test();
                 }
                 if ($uri == "/add_test/question") {
                     $controller->new_question();
                 }
                 if ($uri == "/add_test/test/add") {
                     $controller->add_new_test();
                 }
                 if ($uri == "/add_test/question/add") {
                     $controller->add_new_question();
                 }
                 break;
             case "/logout":
                 include_once "/core/logout.php";
                 $controller = new Logout();
                 $controller->logout();
                 break;
             case "/registration":
             case "/registration/registration":
                 include_once "/core/registration.php";
                 $controller = new Registration();
                 if ($uri == "/registration") {
                     $controller->view();
                 }
                 if ($uri == "/registration/registration") {
                     $controller->registration();
                 }
                 break;
             case "/login":
             case "/login/login":
                 include_once "/core/login.php";
                 $controller = new Login();
                 if ($uri == "/login") {
                     $controller->view();
                 } else {
                     $controller->login();
                 }
                 break;
             default:
                 include_once "/core/index.php";
                 $controller = new Home();
                 $controller->view();
                 break;
         }
     } else {
         switch ($uri) {
             case "/registration":
             case "/registration/registration":
                 include_once "/core/registration.php";
                 $controller = new Registration();
//.........这里部分代码省略.........
开发者ID:sasha2567,项目名称:rabota,代码行数:101,代码来源:index.php

示例2: testing

    static function testing()
    {
        $ref = new ReflectionClass('Test');
        foreach (array('pub', 'pro', 'pri') as $name) {
            try {
                var_dump($ref->getStaticPropertyValue($name));
                var_dump($ref->getStaticPropertyValue($name));
                $ref->setStaticPropertyValue($name, 'updated');
                var_dump($ref->getStaticPropertyValue($name));
            } catch (Exception $e) {
                echo "EXCEPTION\n";
            }
        }
    }
}
$ref = new ReflectionClass('Test');
foreach (array('pub', 'pro', 'pri') as $name) {
    try {
        var_dump($ref->getStaticPropertyValue($name));
        var_dump($ref->getStaticPropertyValue($name));
        $ref->setStaticPropertyValue($name, 'updated');
        var_dump($ref->getStaticPropertyValue($name));
    } catch (Exception $e) {
        echo "EXCEPTION\n";
    }
}
Test::testing();
TestDerived::testing();
?>
===DONE===
开发者ID:gleamingthecube,项目名称:php,代码行数:30,代码来源:ext_reflection_tests_006.php

示例3: testing

<?php 
class MyException extends Exception
{
}
class Test
{
    public function testing()
    {
        try {
            try {
                throw new MyException('foo!');
            } catch (MyException $e) {
                // rethrow it
                throw $e;
            }
        } catch (Exception $e) {
            var_dump($e->getMessage());
        }
    }
}
$foo = new Test();
$foo->testing();
开发者ID:shambhukumar,项目名称:code,代码行数:22,代码来源:customexception.php


注:本文中的Test::testing方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。