コード例 #1
0
ファイル: HttpTest.php プロジェクト: jorgenils/zend-framework
 public function testSetResponseCodeThrowsExceptionWithBadCode()
 {
     try {
         $this->_response->setHttpResponseCode(99);
         $this->fail('Should not accept response codes < 100');
     } catch (Exception $e) {
     }
     try {
         $this->_response->setHttpResponseCode(600);
         $this->fail('Should not accept response codes > 599');
     } catch (Exception $e) {
     }
     try {
         $this->_response->setHttpResponseCode('bogus');
         $this->fail('Should not accept non-integer response codes');
     } catch (Exception $e) {
     }
 }
コード例 #2
0
ファイル: HttpTest.php プロジェクト: lortnus/zf1
 public function testIsNotRedirectWithSufficientlyLarge3xxResponseCodeSet()
 {
     $this->_response->setHttpResponseCode(309);
     $this->assertFalse($this->_response->isRedirect());
 }
コード例 #3
0
ファイル: HttpTest.php プロジェクト: jorgenils/zend-framework
 public function testIsRedirectWhen3xxResponseCodeSet()
 {
     $this->_response->setHttpResponseCode(301);
     $this->assertTrue($this->_response->isRedirect());
 }