<?php

class DeliveryTest extends \DatabaseTestCase
{
    /**
     * @dataProvider data_testWorkdays
     */
    public function testWorkdays($date, $isWorkday)
    {
        $delivery = Delivery::getAll()[3];
        $this->assertSame($isWorkday, $delivery->isWorkday($date));
    }

    public function data_testWorkdays()
    {
        return [
            [new DateTime('2017-01-01'), false], // Novy rok
            [new DateTime('2017-07-06'), false], // Hus
            [new DateTime('2017-05-01'), false], // Prace
            [new DateTime('2017-05-02'), true], // Nic
            [new DateTime('2017-04-17'), false], // Pondeli
            [new DateTime('2017-04-14'), false], // Velky patek
            [new DateTime('2017-04-13'), true], // Nic
            [new DateTime('2017-07-29'), false], // Sobota
            [new DateTime('2017-07-30'), false], // Neděle
        ];
    }
}
