Example #1
0
 /**
  * Get cookies
  *
  * @return array
  */
 public function getCookies()
 {
     $cookies = parent::getHeader('Set-Cookie');
     if (!$cookies) {
         return false;
     } else {
         if ($cookies && !is_array($cookies)) {
             $cookies = array($cookies);
         }
     }
     $result = array();
     foreach ($cookies as $cookie) {
         $result[] = new Cookie($cookie);
     }
     return $result;
 }
Example #2
0
 public function testToString()
 {
     $body = new Body();
     $body->append(rand(0, 100000));
     $response = new Response();
     $response->setBody($body);
     $message = new Message($response->toString());
     $this->assertSame(200, $message->getResponseCode());
     //$this->assertSame($body, $object->body);
     $this->assertSame('Skeetr 0.0.1', $message->getHeader('Server'));
     $this->assertSame('text/html', $message->getHeader('Content-Type'));
     $this->assertSame(strlen($body), $message->getHeader('Content-Length'));
 }
Example #3
0
 /**
  * Get URL
  *
  * @return string
  */
 public function getRequestUrl()
 {
     return parent::getRequestUrl();
 }