Doctrine\Tests\ODM\CouchDB\AttachmentTest::testCreateFromBinaryData PHP Method

testCreateFromBinaryData() public method

    public function testCreateFromBinaryData()
    {
        $text = "Hello i am a string";
        $attachment = Attachment::createFromBinaryData($text, "text/plain");
        $this->assertEquals($text, $attachment->getRawData());
        $this->assertEquals("text/plain", $attachment->getContentType());
        $this->assertEquals("SGVsbG8gaSBhbSBhIHN0cmluZw==", $attachment->getBase64EncodedData());
        $this->assertEquals(28, $attachment->getLength());
    }