You are here

public function RounderTest::testValid in Commerce Core 8.2

Tests rounding a valid price.

::covers round.

File

modules/price/tests/src/Unit/RounderTest.php, line 62

Class

RounderTest
Tests the Rounder class.

Namespace

Drupal\Tests\commerce_price\Unit

Code

public function testValid() {
  $rounded_price = $this->rounder
    ->round(new Price('3.3698', 'USD'));
  $this
    ->assertEquals('3.37', $rounded_price
    ->getNumber());
  $this
    ->assertEquals('USD', $rounded_price
    ->getCurrencyCode());
}