Completed
Pull Request — master (#1)
by Kamil
07:23
created

StaticContentPage   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 6

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 6
dl 0
loc 29
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A access() 0 4 1
A assertPageHasContent() 0 7 1
A getRouteName() 0 4 1
1
<?php
2
3
namespace Lakion\SyliusCmsBundle\Tests\Behat\Page\Shop;
4
5
use Lakion\SyliusCmsBundle\Document\StaticContent;
6
use Sylius\Behat\Page\SymfonyPage;
7
use Webmozart\Assert\Assert;
8
9
final class StaticContentPage extends SymfonyPage implements StaticContentPageInterface
10
{
11
    /**
12
     * {@inheritdoc}
13
     */
14
    public function access($path)
15
    {
16
        return $this->getDriver()->visit($this->makePathAbsolute($path));
17
    }
18
19
    /**
20
     * {@inheritdoc}
21
     */
22
    public function assertPageHasContent(StaticContent $staticContent)
23
    {
24
        $this->verify(['name' => $staticContent->getName()]);
25
26
        Assert::contains($this->getSession()->getPage()->getHtml(), $staticContent->getTitle());
27
        Assert::contains($this->getSession()->getPage()->getHtml(), $staticContent->getBody());
28
    }
29
30
    /**
31
     * {@inheritdoc}
32
     */
33
    public function getRouteName()
34
    {
35
        return 'lakion_sylius_cms_shop_static_content_show';
36
    }
37
}
38