for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Adlogix\EventSchedulerTest\TemporalExpression;
use DateTime;
use PHPUnit\Framework\TestCase;
use Adlogix\EventScheduler\TemporalExpression\DayInWeek;
use Adlogix\EventScheduler\ValueObject\WeekDay;
class DayInWeekTest extends TestCase
{
/**
* @test
*/
public function includes_GivenDateAtSameWeekDay_ShouldReturnTrue()
$date = new DateTime('2015-04-12');
$expr = DayInWeek::sunday();
$isIncluded = $expr->includes($date);
$this->assertThat($isIncluded, $this->isTrue());
}
public function includes_GivenDateAtDifferentWeekDay_ShouldReturnFalse()
$expr = DayInWeek::friday();
$this->assertThat($isIncluded, $this->isFalse());