You are here

public function StrPadTest::testStrPadRightWithPadStringZero in Tamper 8

Test String pad Right With Pad String Zero.

@covers ::tamper

File

tests/src/Unit/Plugin/Tamper/StrPadTest.php, line 60

Class

StrPadTest
Tests the StrPad plugin.

Namespace

Drupal\Tests\tamper\Unit\Plugin\Tamper

Code

public function testStrPadRightWithPadStringZero() {
  $config = [
    StrPad::SETTING_PAD_LENGTH => '5',
    StrPad::SETTING_PAD_STRING => '0',
    StrPad::SETTING_PAD_TYPE => STR_PAD_RIGHT,
  ];
  $plugin = new StrPad($config, 'StrPad', [], $this
    ->getMockSourceDefinition());

  // Can't use 1.0 since 1.0 == 1.000.
  $this
    ->assertEquals('A.000', $plugin
    ->tamper('A.0'));
}