public function StrPadTest::testStrPadRight in Tamper 8
Test String pad Right.
@covers ::tamper
File
- tests/
src/ Unit/ Plugin/ Tamper/ StrPadTest.php, line 44
Class
- StrPadTest
- Tests the StrPad plugin.
Namespace
Drupal\Tests\tamper\Unit\Plugin\TamperCode
public function testStrPadRight() {
$config = [
StrPad::SETTING_PAD_LENGTH => '10',
StrPad::SETTING_PAD_STRING => ' ',
StrPad::SETTING_PAD_TYPE => STR_PAD_RIGHT,
];
$plugin = new StrPad($config, 'StrPad', [], $this
->getMockSourceDefinition());
$this
->assertEquals('hi ', $plugin
->tamper('hi'));
}