Completed
Push — master ( c28e46...490f4f )
by Paweł
10s
created

ShowPage::getBlockImageUrl()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Lakion\SyliusCmsBundle\Tests\Behat\Page\Admin\CustomBlock;
4
5
use Sylius\Behat\Page\SymfonyPage;
6
7
class ShowPage extends SymfonyPage implements ShowPageInterface
8
{
9
    /**
10
     * {@inheritdoc}
11
     */
12
    public function getBlockContents()
13
    {
14
        return $this->getElement('block')->getHtml();
15
    }
16
17
    /**
18
     * {@inheritdoc}
19
     */
20
    public function getBlockImageUrl()
21
    {
22
        return $this->getElement('block')->find('css', 'img')->getAttribute('src');
23
    }
24
25
    /**
26
     * {@inheritdoc}
27
     */
28
    protected function getDefinedElements()
29
    {
30
        return array_merge(parent::getDefinedElements(), [
31
            'block' => '#lakion_sylius_cms_block_preview',
32
        ]);
33
    }
34
35
    /**
36
     * {@inheritdoc}
37
     */
38
    public function getRouteName()
39
    {
40
        return 'lakion_sylius_cms_admin_custom_block_show';
41
    }
42
}
43