Completed
Push — master ( b05eaa...0a1951 )
by Paweł
16:26 queued 07:46
created

IndexPage::specifyFilterDateTo()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 1
1
<?php
2
3
/*
4
 * This file is part of the Sylius package.
5
 *
6
 * (c) Paweł Jędrzejewski
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Sylius\Behat\Page\Admin\Order;
13
14
use Sylius\Behat\Page\Admin\Crud\IndexPage as BaseIndexPage;
15
16
/**
17
 * @author Grzegorz Sadowski <[email protected]>
18
 */
19
class IndexPage extends BaseIndexPage implements IndexPageInterface
20
{
21
    /**
22
     * {@inheritdoc}
23
     */
24
    public function specifyFilterDateFrom(\DateTime $dateTime)
25
    {
26
        $timestamp = $dateTime->getTimestamp();
27
28
        $this->getDocument()->fillField('criteria_date_from_date', date('Y-m-d', $timestamp));
29
        $this->getDocument()->fillField('criteria_date_from_time', date('H:i', $timestamp));
30
    }
31
32
    /**
33
     * {@inheritdoc}
34
     */
35
    public function specifyFilterDateTo(\DateTime $dateTime)
36
    {
37
        $timestamp = $dateTime->getTimestamp();
38
39
        $this->getDocument()->fillField('criteria_date_to_date', date('Y-m-d', $timestamp));
40
        $this->getDocument()->fillField('criteria_date_to_time', date('H:i', $timestamp));
41
    }
42
}
43