public function testVia() { $fakeHttp = new FakeHttp(array($this, 'logRequest')); $viaPortHttp = new ViaPortHttp($fakeHttp, 'proxy.example.com:1234'); $viaPortHttp->send('GET', 'http://foo.example.com', NULL, array('Accept' => 'text/javascript')); $this->assertEquals(array('GET', 'http://proxy.example.com:1234', NULL, array('Accept' => 'text/javascript', 'Host' => 'foo.example.com')), $this->lastCall); $viaPortHttp->send('POST', 'http://bar.example.com:567/foo/bar?whiz=bang', NULL); $this->assertEquals(array('POST', 'http://proxy.example.com:1234/foo/bar?whiz=bang', NULL, array('Host' => 'bar.example.com')), $this->lastCall); }