-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d05dfea
commit 38403de
Showing
6 changed files
with
155 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
namespace Tests\Helpers; | ||
|
||
use Done\Subtitles\Code\Helpers; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class RemoveHtmlTest extends TestCase | ||
{ | ||
public function testRemoveHtml() | ||
{ | ||
$this->assertEquals('a', Helpers::removeOnlyHtmlTags('<b>a</b>'), 1); | ||
$this->assertEquals('a', Helpers::removeOnlyHtmlTags('<b style="something">a</b>'), 2); | ||
$this->assertEquals('a', Helpers::removeOnlyHtmlTags('a<br>'), 3); | ||
$this->assertEquals('a', Helpers::removeOnlyHtmlTags('a<br >'), 4); | ||
$this->assertEquals('a', Helpers::removeOnlyHtmlTags('a<br />'), 5); | ||
$this->assertEquals('a', Helpers::removeOnlyHtmlTags('a<br/>'), 6); | ||
$this->assertEquals('a b', Helpers::removeOnlyHtmlTags('a <a href="something">b</a>'), 7); | ||
$this->assertEquals('a <a sentence is here>', Helpers::removeOnlyHtmlTags('a <a sentence is here>'), 8); | ||
$this->assertEquals('a b', Helpers::removeOnlyHtmlTags('a <i> <i> b')); | ||
$this->assertEquals('a ', Helpers::removeOnlyHtmlTags('a </ I>')); | ||
$this->assertEquals(' www.url.net ', Helpers::removeOnlyHtmlTags('<font color = "# 00ffff"> www.url.net </ font> </ font>')); | ||
$this->assertEquals('word', Helpers::removeOnlyHtmlTags('<font COLOR="WHITE">word')); | ||
$this->assertEquals('<font', Helpers::removeOnlyHtmlTags('<font')); | ||
$this->assertEquals('<font color = ', Helpers::removeOnlyHtmlTags('<font color = ')); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters