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


PHP Slim::status方法代码示例

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


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

示例1: testSlimStatus

    /**
     * Test Slim::status
     *
     * Pre-conditions:
     * You have initialized a Slim app and set the status code.
     *
     * Post-conditions:
     * The Response status code is set correctly.
     */
    public function testSlimStatus(){
        Slim::init();
        Slim::status(302);
        $this->assertSame(Slim::response()->status(), 302);

        $this->setExpectedException('InvalidArgumentException');
        Slim::init();
        Slim::status(900);
    }
开发者ID:ntdt,项目名称:Slim,代码行数:18,代码来源:SlimTest.php

示例2: testSlimStatusHelperSetsResponseStatusCode

 /**
  * Test Slim sets status code
  *
  * Pre-conditions:
  * You have initialized a Slim app and set the status code.
  *
  * Post-conditions:
  * The Response status code is set correctly.
  */
 public function testSlimStatusHelperSetsResponseStatusCode()
 {
     Slim::init();
     Slim::status(302);
     $this->assertSame(Slim::response()->status(), 302);
 }
开发者ID:kolanos,项目名称:Slim,代码行数:15,代码来源:SlimTest.php

示例3: testSlimStatus

 /**
  * Test Slim::status
  *
  * Pre-conditions:
  * Slim app instantiated;
  * Case A: Valid HTTP status is set using helper method;
  * Case B: Invalid HTTP status is set using helper method;
  *
  * Post-conditions:
  * Case A: The Response status code is set correctly;
  * Case B: InvalidArgumentException is thrown;
  */
 public function testSlimStatus()
 {
     $app1 = new Slim();
     //Case A
     $app1->status(302);
     $this->assertSame($app1->response()->status(), 302);
     //Case B
     $this->setExpectedException('InvalidArgumentException');
     $app2 = new Slim();
     $app2->status(900);
 }
开发者ID:inscriptionweb,项目名称:lebonmail,代码行数:23,代码来源:SlimTest.php

示例4: testStatus

 /**
  * Test status
  */
 public function testStatus()
 {
     $s = new Slim();
     $s->get('/bar', function () use($s) {
         $s->status(403);
     });
     $s->call();
     $this->assertEquals(403, $s->response()->status());
 }
开发者ID:rs3d,项目名称:Slimplr,代码行数:12,代码来源:SlimTest.php

示例5: testStatus

 /**
  * Test status
  */
 public function testStatus()
 {
     $s = new Slim();
     $s->get('/bar', function () use($s) {
         $s->status(403);
     });
     $env = $s->environment();
     list($status, $header, $body) = $s->call($env);
     $this->assertEquals(403, $status);
 }
开发者ID:nerdfiles,项目名称:slim_bp,代码行数:13,代码来源:SlimTest.php


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