You are here

public function IntervalTest::testSubtraction in Commerce Core 8.2

@dataProvider subtractionDateProvider

File

tests/src/Kernel/IntervalTest.php, line 72

Class

IntervalTest
Tests the Interval class.

Namespace

Drupal\Tests\commerce\Kernel

Code

public function testSubtraction($date, Interval $interval, $expected_date) {
  $date = DrupalDateTime::createFromFormat('Y-m-d H:i', $date);
  $expected_date = DrupalDateTime::createFromFormat('Y-m-d H:i', $expected_date);
  $this
    ->assertEquals($expected_date, $interval
    ->subtract($date));
}