You are here

public function FormatPriceTest::pricesProvider in Commerce Google Tag Manager 8.2

Same name and namespace in other branches
  1. 8 tests/src/Unit/FormatPriceTest.php \Drupal\Tests\commerce_google_tag_manager\Unit\FormatPriceTest::pricesProvider()

Prices to format.

Return value

array The prices.

File

tests/src/Unit/FormatPriceTest.php, line 35

Class

FormatPriceTest
Tests the formatPrice of EventTrackerService class.

Namespace

Drupal\Tests\commerce_google_tag_manager\Unit

Code

public function pricesProvider() {
  return [
    // Default & standard behavior.
    [
      0,
      0,
    ],
    [
      12,
      12,
    ],
    [
      11.99,
      11.99,
    ],
    // Number should be truncat to 2 decimals maximum.
    [
      123.123,
      123.12,
    ],
    // Number should not be rounded up.
    [
      11.999,
      11.99,
    ],
    // No Thousands separators should be present in the output.
    [
      43123,
      43123,
    ],
    [
      43123.987,
      43123.98,
    ],
  ];
}