You are here

public function IntervalTest::testFlooring in Commerce Core 8.2

@dataProvider flooringDateProvider

File

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

Class

IntervalTest
Tests the Interval class.

Namespace

Drupal\Tests\commerce\Kernel

Code

public function testFlooring($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
    ->floor($date));
}