Beispiel #1
0
 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) {
     }
 }
Beispiel #2
0
 public function testIsNotRedirectWithSufficientlyLarge3xxResponseCodeSet()
 {
     $this->_response->setHttpResponseCode(309);
     $this->assertFalse($this->_response->isRedirect());
 }
Beispiel #3
0
 public function testIsRedirectWhen3xxResponseCodeSet()
 {
     $this->_response->setHttpResponseCode(301);
     $this->assertTrue($this->_response->isRedirect());
 }