You are here

public function HtmlEntityDecodeTest::testNoStringException in Tamper 8

Test non string input throws an exception.

File

tests/src/Unit/Plugin/Tamper/HtmlEntityDecodeTest.php, line 33

Class

HtmlEntityDecodeTest
Tests the html entity decode plugin.

Namespace

Drupal\Tests\tamper\Unit\Plugin\Tamper

Code

public function testNoStringException() {
  $this
    ->expectException(TamperException::class);
  $this
    ->expectExceptionMessage('Input should be a string.');
  $this->plugin
    ->tamper(43);
  $this
    ->expectException(TamperException::class);
  $this
    ->expectExceptionMessage('Input should be a string.');
  $this->plugin
    ->tamper([
    'awesomes4uc3!',
  ]);
  $this
    ->expectException(TamperException::class);
  $this
    ->expectExceptionMessage('Input should be a string.');
  $this->plugin
    ->tamper(NULL);
}