Refresh
This commit is contained in:
40
tests/Feature/CleanerTest.php
Executable file
40
tests/Feature/CleanerTest.php
Executable file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @coversNothing
|
||||
*/
|
||||
class CleanerTest extends TestCase
|
||||
{
|
||||
public function testPlainTextStringDefaultParams()
|
||||
{
|
||||
$sourceString = 'hello world';
|
||||
$expectedString = 'hello world';
|
||||
|
||||
$this->assertSame($expectedString, \App\Helpers\Cleaner::cleanupString($sourceString));
|
||||
}
|
||||
|
||||
public function testPlainTextStringRemoveExtraSpaces()
|
||||
{
|
||||
$sourceString = ' hello world ';
|
||||
$expectedString = 'hello world';
|
||||
|
||||
$this->assertSame($expectedString, \App\Helpers\Cleaner::cleanupString($sourceString, true, true));
|
||||
}
|
||||
|
||||
public function testStripTags()
|
||||
{
|
||||
$sourceString = '<script type="text/javascript">hello <span>world</span></script>';
|
||||
$expectedString = 'hello world';
|
||||
|
||||
$this->assertSame($expectedString, \App\Helpers\Cleaner::cleanupString($sourceString, true, true));
|
||||
}
|
||||
|
||||
public function testHtmlStringDefaultParams()
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user