MINOR Added test for HTTP::getLinksIn() which subsequently tests HTTP::findByTagAndAttribute()

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@70053 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2009-01-13 03:29:14 +00:00 committed by Sam Minnee
parent 53bc0a28dc
commit 66efcd62c7

View File

@ -7,6 +7,21 @@
*/
class HTTPTest extends SapphireTest {
/**
* Tests {@link HTTP::getLinksIn()}
*/
public function testGetLinksIn() {
$content = '
<h2>My page</h2>
<p>A boy went <a href="home/">home</a> to see his <span><a href="mother/">mother</a></span>.</p>
';
$links = HTTP::getLinksIn($content);
$this->assertTrue(is_array($links));
$this->assertTrue(count($links) == 2);
}
/**
* Tests {@link HTTP::setGetVar()}
*/