Exemplo n.º 1
0
 public function testCreateJson()
 {
     $doc = MimedDocument::createJson('foo');
     $this->assertInstanceOf(MimedDocument::class, $doc);
     $this->assertEquals('application/json', $doc->mime());
     $this->assertEquals('foo', $doc->content());
     $this->assertEquals('foo', $doc);
 }
Exemplo n.º 2
0
 public function render($data)
 {
     return MimedDocument::createJson(json_encode($data));
 }