public function testManualContentHandling() { Media::type('custom', 'text/x-custom'); $response = new Response(); $response->type('custom'); Media::render($response, 'Hello, world!', array('layout' => false, 'template' => false, 'encode' => function ($data) { return "Message: {$data}"; })); $result = $response->body; $expected = array("Message: Hello, world!"); $this->assertEqual($expected, $result); $this->assertException("/Template not found/", function () use($response) { Media::render($response, 'Hello, world!'); }); }