client = new Parse(); $this->client->http = new p3k\HTTP\Test(dirname(__FILE__).'/data/'); $this->client->mc = null; } private function parse($params) { $request = new Request($params); $response = new Response(); return $this->client->parse($request, $response); } public function testAllowsWhitelistedTags() { $url = 'http://sanitize.example/entry-with-valid-tags'; $response = $this->parse(['url' => $url]); $body = $response->getContent(); $this->assertEquals(200, $response->getStatusCode()); $data = json_decode($body, true); $html = $data['data']['content']['html']; $this->assertEquals('entry', $data['data']['type']); $this->assertContains('This content has only valid tags.', $html); $this->assertContains('links,', $html, ' missing'); $this->assertContains('abbreviations,', $html, ' missing'); $this->assertContains('bold,', $html, ' missing'); $this->assertContains('inline code,', $html, ' missing'); $this->assertContains('delete,', $html, ' missing'); $this->assertContains('emphasis,', $html, ' missing'); $this->assertContains('italics,', $html, ' missing'); $this->assertContains('images are allowed', $html, ' missing'); $this->assertContains('inline quote,', $html, ' missing'); $this->assertContains('strikethrough,', $html, ' missing'); $this->assertContains('strong text,', $html, ' missing'); $this->assertContains('', $html, '