Completed
Pull Request — master (#1)
by Kamil
08:27
created

StaticContentPage::assertPageHasContent()   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
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