You are here

public function SprintfTest::testSprintfLeadingZeroes in Tamper 8

Test using text format %08d.

File

tests/src/Unit/Plugin/Tamper/SprintfTest.php, line 32

Class

SprintfTest
Tests the sprintf plugin.

Namespace

Drupal\Tests\tamper\Unit\Plugin\Tamper

Code

public function testSprintfLeadingZeroes() {
  $config = [
    Sprintf::SETTING_TEXT_FORMAT => '%08d',
  ];
  $plugin = new Sprintf($config, 'sprintf', [], $this
    ->getMockSourceDefinition());
  $this
    ->assertEquals('00000123', $plugin
    ->tamper('0123'));
}