public function NumberFormatTest::testNumberFormatDefaultWithNumber in Tamper 8
Test zero decimal and thousands seperator with number.
File
- tests/
src/ Unit/ Plugin/ Tamper/ NumberFormatTest.php, line 55
Class
- NumberFormatTest
- Tests the number format plugin.
Namespace
Drupal\Tests\tamper\Unit\Plugin\TamperCode
public function testNumberFormatDefaultWithNumber() {
$config = [
NumberFormat::SETTING_DECIMALS => '2',
NumberFormat::SETTING_DEC_POINT => '.',
NumberFormat::SETTING_THOUSANDS_SEP => '',
];
$plugin = new NumberFormat($config, 'number_format', [], $this
->getMockSourceDefinition());
$this
->assertEquals('1234.57', $plugin
->tamper(1234.5678));
}