mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
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:
parent
53bc0a28dc
commit
66efcd62c7
@ -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()}
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user