Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed Gaufrette compatibility for empty blobs

  • Loading branch information...
commit 1dabcfb13ed24b6f8d4a33921e39920bf50f9aa1 1 parent 05c6313
@magnusnordlander magnusnordlander authored
View
4 src/Gittern/Entity/GitObject/Blob.php
@@ -23,11 +23,11 @@ public function getSha()
public function setContents($contents)
{
- $this->contents = $contents;
+ $this->contents = (string) $contents;
}
public function getContents()
{
- return $this->contents;
+ return (string) $this->contents;
}
}
View
5 tests/Gittern/Entity/GitObject/BlobTest.php
@@ -28,4 +28,9 @@ public function testCanSetAndGetContents()
$this->blob->setContents('foobar');
$this->assertEquals('foobar', $this->blob->getContents());
}
+
+ public function testContentsAreAlwaysStrings()
+ {
+ $this->assertSame('', $this->blob->getContents());
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.