Exemplo n.º 1
0
 public function testCanChangePort()
 {
     $r = new puzzle_message_Request('GET', 'http://www.foo.com:222');
     $this->assertSame(222, $r->getPort());
     $this->assertEquals('www.foo.com', $r->getHost());
     $this->assertEquals('www.foo.com:222', $r->getHeader('host'));
     $r->setPort(80);
     $this->assertSame(80, $r->getPort());
     $this->assertEquals('www.foo.com', $r->getHost());
     $this->assertEquals('www.foo.com', $r->getHeader('host'));
 }
Exemplo n.º 2
0
 public function testSetsIntegersAndFloatsAsHeaders()
 {
     $h = new puzzle_message_Request('GET', 'http://foo.com');
     $h->setHeader('foo', 10);
     $h->setHeader('bar', 10.5);
     $h->addHeader('foo', 10);
     $h->addHeader('bar', 10.5);
     $this->assertSame('10, 10', $h->getHeader('foo'));
     $this->assertSame('10.5, 10.5', $h->getHeader('bar'));
 }