You are here

public function NumberFormatTest::testNumberFormatFrenchNotationWithNumber in Tamper 8

Test french notation with number.

File

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

Class

NumberFormatTest
Tests the number format plugin.

Namespace

Drupal\Tests\tamper\Unit\Plugin\Tamper

Code

public function testNumberFormatFrenchNotationWithNumber() {
  $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,57', $plugin
    ->tamper(1234.5678));
}