0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-09-19 10:45:18 +00:00
htmlpurifier/tests/HTMLPurifier/URIFilter/DisableExternalTest.php
Marcus Bointon fac747bdbd PSR-2 reformatting PHPDoc corrections
With minor corrections.

Signed-off-by: Marcus Bointon <marcus@synchromedia.co.uk>
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
2013-08-17 22:27:26 -04:00

61 lines
1.3 KiB
PHP

<?php
class HTMLPurifier_URIFilter_DisableExternalTest extends HTMLPurifier_URIFilterHarness
{
public function setUp()
{
parent::setUp();
$this->filter = new HTMLPurifier_URIFilter_DisableExternal();
}
public function testRemoveExternal()
{
$this->assertFiltering(
'http://example.com', false
);
}
public function testPreserveInternal()
{
$this->assertFiltering(
'/foo/bar'
);
}
public function testPreserveOurHost()
{
$this->config->set('URI.Host', 'example.com');
$this->assertFiltering(
'http://example.com'
);
}
public function testPreserveOurSubdomain()
{
$this->config->set('URI.Host', 'example.com');
$this->assertFiltering(
'http://www.example.com'
);
}
public function testRemoveSuperdomain()
{
$this->config->set('URI.Host', 'www.example.com');
$this->assertFiltering(
'http://example.com', false
);
}
public function testBaseAsHost()
{
$this->config->set('URI.Base', 'http://www.example.com/foo/bar');
$this->assertFiltering(
'http://www.example.com/baz'
);
}
}
// vim: et sw=4 sts=4