author_url = 'https://joe.bloggs/'; $this->assertEquals('https://joe.bloggs', $like->author_url); } public function test_plaintext_like_content() { $like = new Like(); $like->url = 'https://example.org/post/123'; $like->content = 'some plaintext content'; $like->save(); $this->assertEquals('some plaintext content', $like->content); } public function test_html_like_content_is_filtered() { $htmlEvil = <<

Hello

HTML; $htmlFiltered = <<Hello

HTML; $like = new Like(); $like->url = 'https://example.org/post/123'; $like->content = $htmlEvil; $like->save(); // HTMLPurifer will leave the whitespace before the tag // trim it, saving whitespace in $htmlFilteres can get removed by text editors $this->assertEquals($htmlFiltered, trim($like->content)); } }