Skip to content

Commit aae0317

Browse files
committed
fixes #97
1 parent 91ccfdd commit aae0317

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

lib/OpenCloud/ObjectStore/DataObject.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,7 @@ private function Fetch() {
569569
break;
570570
case 'Content-Length':
571571
$this->content_length = $value;
572+
$this->bytes = $value;
572573
break;
573574
default:
574575
$this->extra_headers[$header] = $value;

tests/OpenCloud/Tests/DataObjectTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class DataObjectTest extends \PHPUnit_Framework_TestCase
2222
$container;
2323

2424
public function __construct() {
25-
25+
2626
$conn = new StubConnection('http://example.com', 'SECRET');
2727
$this->service = new StubService(
2828
$conn,
@@ -175,6 +175,7 @@ public function testSetParams() {
175175
public function testFetch() {
176176
$obj = new \OpenCloud\ObjectStore\DataObject($this->container, 'FOO');
177177
$this->assertEquals('FOO', $obj->name);
178+
//$this->assertEquals(999, $obj->bytes);
178179
}
179180
/**
180181
* @expectedException \OpenCloud\Base\Exceptions\CdnNotAvailableError

tests/OpenCloud/Tests/StubConnection.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ public function __construct($url, $secret, $options=array()) {
3131
}
3232
public function Request($url, $method="GET", $headers=array(), $body=NULL) {
3333
$resp = new \OpenCloud\Base\Request\Response\Blank;
34+
$resp->headers = array(
35+
'Content-Length' => '999'
36+
);
3437
if ($method == 'POST') {
3538
$resp->status = 200;
3639
if (strpos($url, '/action')) {

0 commit comments

Comments
 (0)