1
0
Fork 0

Prevent side effects with BBCode::convert in testAutoLinking()

This commit is contained in:
Hypolite Petovan 2019-03-13 00:40:54 -04:00 committed by GitHub
parent fedf29e023
commit c5073e2036
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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