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

ShowPage   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 2
dl 0
loc 36
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getBlockContents() 0 4 1
A getBlockImageUrl() 0 4 1
A getDefinedElements() 0 6 1
A getRouteName() 0 4 1
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