updated-packages
This commit is contained in:
@@ -4,6 +4,7 @@ namespace Cron\Tests;
|
||||
|
||||
use Cron\MonthField;
|
||||
use DateTime;
|
||||
use DateTimeImmutable;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
@@ -23,6 +24,16 @@ class MonthFieldTest extends TestCase
|
||||
$this->assertFalse($f->validate('1.fix-regexp'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Cron\MonthField::isSatisfiedBy
|
||||
*/
|
||||
public function testChecksIfSatisfied()
|
||||
{
|
||||
$f = new MonthField();
|
||||
$this->assertTrue($f->isSatisfiedBy(new DateTime(), '?'));
|
||||
$this->assertTrue($f->isSatisfiedBy(new DateTimeImmutable(), '?'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Cron\MonthField::increment
|
||||
*/
|
||||
@@ -38,6 +49,17 @@ class MonthFieldTest extends TestCase
|
||||
$this->assertSame('2011-02-28 23:59:00', $d->format('Y-m-d H:i:s'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Cron\MonthField::increment
|
||||
*/
|
||||
public function testIncrementsDateTimeImmutable()
|
||||
{
|
||||
$d = new DateTimeImmutable('2011-03-15 11:15:00');
|
||||
$f = new MonthField();
|
||||
$f->increment($d);
|
||||
$this->assertSame('2011-04-01 00:00:00', $d->format('Y-m-d H:i:s'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Cron\MonthField::increment
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user