public function testReplaceWithTemplate() { $this->assertEquals('foo <h1>Title</h1> bar', $this->Replacer->replace('foo http://pass.example.com bar', function ($Media) { return '<h1>' . $Media->title . '</h1>'; })); }