array(array( 'type' => 'quote', 'data' => array( 'text' => 'Text', 'cite' => 'Cite' ) )) )); $html = $converter->toHtml($json); $this->assertEquals( $html, "
" ); // Lets convert a normal text type that uses the default converter $json = json_encode(array( 'data' => array(array( 'type' => 'text', 'data' => array( 'text' => 'test' ) )) )); $html = $converter->toHtml($json); $this->assertEquals($html, "Text
\nCite
\n
test
\n"); // the video conversion $json = json_encode(array( 'data' => array(array( 'type' => 'video', 'data' => array( 'source' => 'youtube', 'remote_id' => '4BXpi7056RM' ) )) )); $html = $converter->toHtml($json); $this->assertEquals( $html, "\n" ); // The heading $json = json_encode(array( 'data' => array(array( 'type' => 'heading', 'data' => array( 'text' => 'test' ) )) )); $html = $converter->toHtml($json); $this->assertEquals($html, "'), '{"data":[{"type":"quote","data":{"text":" Text","cite":" Cite"}}]}' ); $this->assertEquals( $converter->toJson('Text
Cite
'), '{"data":[{"type":"quote","data":{"text":" Text","cite":""}}]}' ); $this->assertEquals( $converter->toJson('Text
'),
'{"data":[{"type":"image","data":{"file":{"url":"\/path\/to\/img.jpg"}}}]}'
);
}
}