Completed
Push — upgrade-boilerplate ( 903b21 )
by Kamil
17:46
created

IndexPage::getDefinedElements()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
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
    /**
44
     * {@inheritdoc}
45
     */
46
    public function chooseChannelFilter($channelName)
47
    {
48
        $this->getElement('filter_channel')->selectOption($channelName);
49
    }
50
51
    /**
52
     * {@inheritdoc}
53
     */
54
    protected function getDefinedElements()
55
    {
56
        return array_merge(parent::getDefinedElements(), [
57
            'filter_channel' => '#criteria_channel_id',
58
        ]);
59
    }
60
}
61