rackspace/php-opencloud — pull request #59 by tomgidden (2013-03-07 16:37:37+00:00)
Title: Add unit tests for #57

As requested, some unit tests. I'm not sure how to test the retrieval of `extra_headers` while using a `StubConnection`, so I've commented those tests out.

The `Fetch` side of `extra_headers` does work in my own code, although it is a little... well, excessive. You might want to trim it a bit. Here's an example of `$obj->extra_headers`:

```
array (
'HTTP/1.1 200 OK
' => 'HTTP/1.1 200 OK',
'Accept-Ranges' => 'bytes',
'Last-Modified' => 'Wed, 06 Mar 2013 23:53:49 GMT',
'Etag' => 'e08565d09c128c9e093c8db3ac069040',
'X-Timestamp' => '1362614029.88735',
'Access-Control-Allow-Origin' => '*',
'X-Trans-Id' => 'txab253b66c5e142caa619bfcdcf1a1d38',
'Date' => 'Wed, 06 Mar 2013 23:53:49 GMT',
'
' => '',
)
```

Ideally, most of those would be stripped out, leaving just the `Access-Control-Allow-Origin` header: the only header actually added by the first test!

Tom