public function IntervalTest::testAddition in Commerce Core 8.2
@dataProvider additionDateProvider
File
- tests/
src/ Kernel/ IntervalTest.php, line 63
Class
- IntervalTest
- Tests the Interval class.
Namespace
Drupal\Tests\commerce\KernelCode
public function testAddition($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
->add($date));
}