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


PHP TestController::index方法代码示例

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


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

示例1: runIndex

 public function runIndex($searchValue, $formInput, $returnValue, $returnValue2 = null, $returnValue3 = null)
 {
     Input::replace($formInput);
     $controller = new TestController();
     $view = $controller->index();
     $tests = $view->getData()['testSet'];
     if (isset($returnValue3)) {
         $field3 = $returnValue3;
         $field2 = $returnValue2;
     } elseif (isset($returnValue2)) {
         $field2 = $returnValue2;
     }
     $field = $returnValue;
     if (is_numeric($searchValue) && $field == 'specimen_id' | $field == 'visit_id') {
         if ($searchValue == '0') {
             $this->assertEquals($searchValue, count($tests));
         } else {
             $this->assertGreaterThanOrEqual(1, count($tests));
         }
     } else {
         foreach ($tests as $key => $test) {
             if (isset($field3)) {
                 $this->assertEquals($searchValue, $test->{$field}->{$field2}->{$field3});
             } elseif (isset($field2)) {
                 $this->assertEquals($searchValue, $test->{$field}->{$field2});
             } else {
                 $this->assertEquals($searchValue, $test->{$field});
             }
         }
     }
 }
开发者ID:BaobabHealthTrust,项目名称:iBLIS,代码行数:31,代码来源:TestControllerTest.php

示例2: testControllerFlash

 function testControllerFlash()
 {
     session_unset();
     $controller = new Controller();
     # sets the ceva from the flash to altceva
     $test = new TestController();
     $this->assertTrue(empty($test->flash));
     $test->index();
     $this->assertEqual($test->flash["ceva"], "altceva");
     # calls the destruct method that puts the flash into the session
     unset($test);
     # reinit test
     $test = new TestController();
     $this->assertEqual($test->flash["ceva"], "altceva");
     $test->index();
     $test->flash["altceva"] = "ceva";
     $this->assertEqual($test->flash["ceva"], "altceva");
     $this->assertEqual($test->flash["altceva"], "ceva");
     # the flash remainds unmodified
     unset($test);
     # the flash is now destroyed
     $test = new TestController();
     $this->assertEqual($test->flash["altceva"], "ceva");
     session_destroy();
 }
开发者ID:hurrycane,项目名称:framework,代码行数:25,代码来源:controller_tests.php


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