Business\Tests\DayTest::testGetClosestOpeningTimeBeforeBetweenIntervals PHP Method

testGetClosestOpeningTimeBeforeBetweenIntervals() public method

    public function testGetClosestOpeningTimeBeforeBetweenIntervals()
    {
        $context = new \DateTime('2015-05-25');
        $day = new Day(Days::MONDAY, [['09:00', '10 AM'], ['12:00', '2 pm'], ['14:30', '18:30']]);
        $closest = $day->getClosestOpeningTimeBefore(new Time('14', '20'), $context);
        $this->assertSame(14, $closest->getHours());
        $this->assertSame(0, $closest->getMinutes());
    }