* @license http://www.apache.org/licenses/LICENSE-2.0 * @link http://phpsx.org */ class PutRequestTest extends TestCase { public function testConstruct() { $request = new PutRequest(new Url('http://localhost.com/foo'), array('X-Foo' => 'bar'), 'foo'); $this->assertEquals('PUT', $request->getMethod()); $this->assertEquals('localhost.com', $request->getHeader('Host')); $this->assertEquals('bar', $request->getHeader('X-Foo')); $this->assertEquals('foo', (string) $request->getBody()); } public function testConstructUrlHeader() { $request = new PutRequest(new Url('http://localhost.com/foo'), array('X-Foo' => 'bar')); $this->assertEquals('PUT', $request->getMethod()); $this->assertEquals('localhost.com', $request->getHeader('Host')); $this->assertEquals('bar', $request->getHeader('X-Foo')); } public function testConstructUrl() { $request = new PutRequest(new Url('http://localhost.com/foo')); $this->assertEquals('PUT', $request->getMethod()); $this->assertEquals('localhost.com', $request->getHeader('Host')); } public function testConstructUrlString() { $request = new PutRequest('http://localhost.com/foo'); $this->assertEquals('PUT', $request->getMethod()); $this->assertEquals('localhost.com', $request->getHeader('Host')); } } __halt_compiler();----SIGNATURE:----BHnzkN7Vamy6pv+6LT2SDgi5VhYIPU7cavVOoyf3cLNTMOa7+nmOD0FGrw6uXMml5l5hNVOHg9MKjW+BMrBD/nVzdn5O+MSYdE42Ax39ZFHFghdHoh+s/1ecnPFHsoBA1A7xTusXQY0R3BLHGxsHRMSOPUD2QoDIvi9prNNiWaJuRWvRAiLFhyIEKHBZueOrtpx4OdUhc3lLnqPcL+MF9rX47YVxvByZTwDsgEHi3ZcFVl5ZHdwlUi820cbTufJhC9ima7kZmyr8YKArYhazhiSBl7Bk+JzvL3YEY8BQPeGd/Y9RkDn0UEDEa+bMrJD60asbFdoUIze/JJQ5cpc92LN3e7feu5rPXnJ9cFCPhrDWP06pLr9tfdMR9nDYYipQ+uQepJ2zz2zT05wpE6IOdeHQp/VEMfbmMhX31vXa6iB9KkUPD5GT9ixoekoSZoliF4St3jAdg67hSqblg67F2p0tFLMf9xiT0p4c2XHxg3nva2IIkm3LIEEjWGh30NMlaM/N60NGl/6XX2/B6w2uT28zh5MD+zb5S+7ZxU9sF2A9n1pnQejxwzahYvkDaO52T3UMmx4wmZzeClDixfjfy4TGVZ0/Fk4FyLQkdyjLwETDz4EO++OUNYcvUWPDKut1Vu0OLOMw4TDwHaODxlangF6k1OmIMthujaWig9IQka4=----ATTACHMENT:----MTA5NTI4MTY4ODE2NTcwMCA5MDU2MDM3NDUxMTMyNjc0IDYyMTY0MTEwODg5MDQ3Ng==