mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Adds unit tests. Props junsuijin, wonderboymusic. Fixes #9959. git-svn-id: https://develop.svn.wordpress.org/trunk@34277 602fd350-edb4-49c9-b593-d223f7449a82
18 lines
611 B
PHP
18 lines
611 B
PHP
<?php
|
|
/**
|
|
* @ticket 9959
|
|
*/
|
|
class Tests_Rel_No_Follow extends WP_UnitTestCase {
|
|
|
|
public function test_add_no_follow() {
|
|
$content = '<p>This is some cool <a href="/">Code</a></p>';
|
|
$expected = '<p>This is some cool <a href=\"/\" rel=\"nofollow\">Code</a></p>';
|
|
$this->assertEquals( $expected, wp_rel_nofollow( $content ) );
|
|
}
|
|
|
|
public function test_convert_no_follow() {
|
|
$content = '<p>This is some cool <a href="/" rel="weird">Code</a></p>';
|
|
$expected = '<p>This is some cool <a href=\"/\" rel=\"weird nofollow\">Code</a></p>';
|
|
$this->assertEquals( $expected, wp_rel_nofollow( $content ) );
|
|
}
|
|
} |