Eccube\Tests\Service\ShoppingServiceTest::testGetFormDeliveryDates PHP Method

testGetFormDeliveryDates() public method

    public function testGetFormDeliveryDates()
    {
        $DeliveryDate = $this->app['eccube.repository.delivery_date']->find(1);
        $Order = $this->createOrder($this->Customer);
        foreach ($Order->getOrderDetails() as $Detail) {
            $Detail->getProductClass()->setDeliveryDate($DeliveryDate);
        }
        $this->app['orm.em']->flush();
        $DeliveryDates = $this->app['eccube.service.shopping']->getFormDeliveryDates($Order);
        $this->expected = $this->app['config']['deliv_date_end_max'];
        $this->actual = count($DeliveryDates);
        $this->verify();
        $dates = array();
        $today = new \DateTime();
        for ($i = 0; $i < $this->app['config']['deliv_date_end_max']; $i++) {
            $dates[$today->format('Y/m/d')] = $today->format('Y/m/d');
            $today->add(new \DateInterval('P1D'));
        }
        $this->expected = $dates;
        $this->actual = $DeliveryDates;
        $this->verify();
    }