You are here

public function UnitTest::testFunctionNoNbspEraser in No Non-breaking Space Filter 8

Test the function _no_nbsp_eraser.

File

src/Tests/UnitTest.php, line 22

Class

UnitTest
Run unit tests on some functions.

Namespace

Drupal\no_nbsp\Tests

Code

public function testFunctionNoNbspEraser() {
  $this
    ->assertEqual(_no_nbsp_eraser('l o l'), 'l o l');
  $this
    ->assertEqual(_no_nbsp_eraser('l  o  l'), 'l o l');
  $this
    ->assertEqual(_no_nbsp_eraser('l  o  l'), 'l o l');
  $this
    ->assertEqual(_no_nbsp_eraser('l   o   l'), 'l o l');
  $this
    ->assertEqual(_no_nbsp_eraser('l  o  l'), 'l o l');
  $this
    ->assertEqual(_no_nbsp_eraser('l  o  l'), 'l o l');
  $this
    ->assertEqual(_no_nbsp_eraser('l o l'), 'l o l');
  $this
    ->assertEqual(_no_nbsp_eraser('l&nbspol'), 'l&nbspol');
  $this
    ->assertEqual(_no_nbsp_eraser(' '), ' ');
  $this
    ->assertEqual(_no_nbsp_eraser(' '), ' ');
  $this
    ->assertEqual(_no_nbsp_eraser('   '), ' ');
  $this
    ->assertEqual(_no_nbsp_eraser(' '), ' ');
  $this
    ->assertEqual(_no_nbsp_eraser('<p>&nbsp;</p>', TRUE), '<p>&nbsp;</p>');
}