You are here

protected function FilterSpamspanUnitTest::wrappedAssert in SpamSpan filter 8

Same name and namespace in other branches
  1. 8.2 tests/src/Kernel/FilterSpamspanUnitTest.php \Drupal\Tests\spamspan\Kernel\FilterSpamspanUnitTest::wrappedAssert()

Wrapper function.

Conveniently wraps some text around main test subject and then asserts.

1 call to FilterSpamspanUnitTest::wrappedAssert()
FilterSpamspanUnitTest::variatedAssert in tests/src/Kernel/FilterSpamspanUnitTest.php
Helper function to assert variations.

File

tests/src/Kernel/FilterSpamspanUnitTest.php, line 95

Class

FilterSpamspanUnitTest
Tests spamspan filter.

Namespace

Drupal\Tests\spamspan\Kernel

Code

protected function wrappedAssert($filter, $input, $shouldbe, $prefix = '', $suffix = '', $message = '') {
  $output = $filter
    ->process($prefix . $input . $suffix, 'und')
    ->getProcessedText();
  if (empty($message)) {
    $this
      ->assertSame($output, $prefix . $shouldbe . $suffix);
  }
  else {
    $this
      ->assertSame($output, $prefix . $shouldbe . $suffix, $message);
  }
}