updated-packages
This commit is contained in:
@@ -4,6 +4,7 @@ namespace Cron\Tests;
|
||||
|
||||
use Cron\DayOfMonthField;
|
||||
use DateTime;
|
||||
use DateTimeImmutable;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
@@ -33,6 +34,7 @@ class DayOfMonthFieldTest extends TestCase
|
||||
{
|
||||
$f = new DayOfMonthField();
|
||||
$this->assertTrue($f->isSatisfiedBy(new DateTime(), '?'));
|
||||
$this->assertTrue($f->isSatisfiedBy(new DateTimeImmutable(), '?'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -50,6 +52,17 @@ class DayOfMonthFieldTest extends TestCase
|
||||
$this->assertSame('2011-03-14 23:59:00', $d->format('Y-m-d H:i:s'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Cron\DayOfMonthField::increment
|
||||
*/
|
||||
public function testIncrementsDateTimeImmutable()
|
||||
{
|
||||
$d = new DateTimeImmutable('2011-03-15 11:15:00');
|
||||
$f = new DayOfMonthField();
|
||||
$f->increment($d);
|
||||
$this->assertSame('2011-03-16 00:00:00', $d->format('Y-m-d H:i:s'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Day of the month cannot accept a 0 value, it must be between 1 and 31
|
||||
* See Github issue #120
|
||||
|
||||
Reference in New Issue
Block a user