You are here

public function NumberFormatTest::testNumberFormatFrenchNotation in Tamper 8

Test french notation with string.

File

tests/src/Unit/Plugin/Tamper/NumberFormatTest.php, line 40

Class

NumberFormatTest
Tests the number format plugin.

Namespace

Drupal\Tests\tamper\Unit\Plugin\Tamper

Code

public function testNumberFormatFrenchNotation() {
  $config = [
    NumberFormat::SETTING_DECIMALS => '2',
    NumberFormat::SETTING_DEC_POINT => ',',
    NumberFormat::SETTING_THOUSANDS_SEP => ' ',
  ];
  $plugin = new NumberFormat($config, 'number_format', [], $this
    ->getMockSourceDefinition());
  $this
    ->assertEquals('1 234,56', $plugin
    ->tamper('1234.56'));
}