You are here

public function IntervalTest::testCeiling in Commerce Core 8.2

@dataProvider ceilingDateProvider

File

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

Class

IntervalTest
Tests the Interval class.

Namespace

Drupal\Tests\commerce\Kernel

Code

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