updated-packages
This commit is contained in:
@@ -4,6 +4,7 @@ namespace Cron\Tests;
|
||||
|
||||
use Cron\HoursField;
|
||||
use DateTime;
|
||||
use DateTimeImmutable;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
@@ -22,7 +23,17 @@ class HoursFieldTest extends TestCase
|
||||
$this->assertTrue($f->validate('01'));
|
||||
$this->assertTrue($f->validate('*'));
|
||||
$this->assertFalse($f->validate('*/3,1,1-12'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Cron\HoursField::isSatisfiedBy
|
||||
*/
|
||||
public function testChecksIfSatisfied()
|
||||
{
|
||||
$f = new HoursField();
|
||||
$this->assertTrue($f->isSatisfiedBy(new DateTime(), '?'));
|
||||
$this->assertTrue($f->isSatisfiedBy(new DateTimeImmutable(), '?'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Cron\HoursField::increment
|
||||
@@ -39,6 +50,17 @@ class HoursFieldTest extends TestCase
|
||||
$this->assertSame('2011-03-15 10:59:00', $d->format('Y-m-d H:i:s'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Cron\HoursField::increment
|
||||
*/
|
||||
public function testIncrementsDateTimeImmutable()
|
||||
{
|
||||
$d = new DateTimeImmutable('2011-03-15 11:15:00');
|
||||
$f = new HoursField();
|
||||
$f->increment($d);
|
||||
$this->assertSame('2011-03-15 12:00:00', $d->format('Y-m-d H:i:s'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Cron\HoursField::increment
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user