]> git.mxchange.org Git - friendica.git/commitdiff
Prevent side effects with BBCode::convert in testAutoLinking()
authorHypolite Petovan <hypolite@mrpetovan.com>
Wed, 13 Mar 2019 04:40:54 +0000 (00:40 -0400)
committerGitHub <noreply@github.com>
Wed, 13 Mar 2019 04:40:54 +0000 (00:40 -0400)
tests/src/Content/Text/BBCodeTest.php

index fe37b91cd1f709e4550d7f6e19b40134c980304b..2f9a244ccc1466fb519f05025ede94b3cbcc1f5d 100644 (file)
@@ -116,12 +116,11 @@ class BBCodeTest extends MockedTest
        public function testAutoLinking($data, $assertHTML)\r
        {\r
                $output = BBCode::convert($data);\r
+               $assert = '<a href="' . $data . '" target="_blank">' . $data . '</a>';\r
                if ($assertHTML) {\r
-                       $assert = '<a href="' . $data . '" target="_blank">' . $data . '</a>';\r
+                       $this->assertEquals($assert, $output);\r
                } else {\r
-                       $assert = $data;\r
+                       $this->assertNotEquals($assert, $output);\r
                }\r
-\r
-               $this->assertEquals($assert, $output);\r
        }\r
 }\r