From 66efcd62c7545a61ddebca96fab2710b0b83d625 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Tue, 13 Jan 2009 03:29:14 +0000 Subject: [PATCH] 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 --- tests/HTTPTest.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/HTTPTest.php b/tests/HTTPTest.php index 15b4fbc5f..4a67bae6e 100644 --- a/tests/HTTPTest.php +++ b/tests/HTTPTest.php @@ -7,6 +7,21 @@ */ class HTTPTest extends SapphireTest { + /** + * Tests {@link HTTP::getLinksIn()} + */ + public function testGetLinksIn() { + $content = ' +

My page

+

A boy went home to see his mother.

+ '; + + $links = HTTP::getLinksIn($content); + + $this->assertTrue(is_array($links)); + $this->assertTrue(count($links) == 2); + } + /** * Tests {@link HTTP::setGetVar()} */