diff --git a/tests/test-class-activitypub-hashtag.php b/tests/test-class-activitypub-hashtag.php index e7699d2..5c207bd 100644 --- a/tests/test-class-activitypub-hashtag.php +++ b/tests/test-class-activitypub-hashtag.php @@ -4,26 +4,26 @@ class Test_Activitypub_Hashtag extends WP_UnitTestCase { * @dataProvider the_content_provider */ public function test_the_content( $content, $content_with_hashtag ) { - $content = \Activitypub\Hashtag::the_content( $content ); - - $this->assertEquals( $content_with_hashtag, $content ); - } - - public function the_content_provider() { \wp_create_term( 'object', 'post_tag' ); $object = \get_term_by( 'name', 'object', 'post_tag' ); $link = \get_term_link( $object, 'post_tag' ); + $content = \Activitypub\Hashtag::the_content( $content ); + + $this->assertEquals( sprintf( $content_with_hashtag, $link ), $content ); + } + + public function the_content_provider() { return array( array( 'test', 'test' ), array( '#test', '#test' ), array( 'hallo #test test', 'hallo #test test' ), - array( 'hallo #object test', 'hallo test' ), - array( '#object test', ' test' ), + array( 'hallo #object test', 'hallo test' ), + array( '#object test', ' test' ), array( 'hallo test test', 'hallo test test' ), array( 'hallo #test test', 'hallo #test test' ), - array( '
hallo #object test
', '
hallo test
' ), - array( '
hallo #object
', '
hallo
' ), + array( '
hallo #object test
', '
hallo test
' ), + array( '
hallo #object
', '
hallo
' ), array( '
#object
', '
#object
' ), array( '#object', '#object' ), array( '
object', '
object' ),