You are here

public function TrimTest::testTrimRightSide in Tamper 8

Test trimming right side.

File

tests/src/Unit/Plugin/Tamper/TrimTest.php, line 41

Class

TrimTest
Tests the trim plugin.

Namespace

Drupal\Tests\tamper\Unit\Plugin\Tamper

Code

public function testTrimRightSide() {
  $config = [
    Trim::SETTING_CHARACTER => '',
    Trim::SETTING_SIDE => 'rtrim',
  ];
  $plugin = new Trim($config, 'trim', [], $this
    ->getMockSourceDefinition());
  $this
    ->assertEquals('  asdfasf', $plugin
    ->tamper('  asdfasf  '));
}