Completed
Pull Request — 3.1 (#348)
by Piotr
20:24
created

DisplayContext::setKernel()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
/**
4
 * (c) FSi sp. z o.o. <[email protected]>
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
declare(strict_types=1);
11
12
namespace FSi\Bundle\AdminBundle\Behat\Context;
13
14
use Behat\Gherkin\Node\TableNode;
15
use Behat\Symfony2Extension\Context\KernelAwareContext;
16
use SensioLabs\Behat\PageObjectExtension\Context\PageObjectContext;
17
use Symfony\Component\HttpKernel\KernelInterface;
18
19
class DisplayContext extends PageObjectContext implements KernelAwareContext
20
{
21
    /**
22
     * @var KernelInterface
23
     */
24
    protected $kernel;
25
26
    public function setKernel(KernelInterface $kernel): void
27
    {
28
        $this->kernel = $kernel;
29
    }
30
31
    /**
32
     * @Given /^I should see display with following fields$/
33
     */
34
    public function iShouldSeeDisplayWithFollowingFields(TableNode $table)
35
    {
36
        $display = $this->getPage('News display')->getElement('Display');
37
        foreach ($table->getHash() as $row) {
38
            expect($display->hasFieldWithName($row['Field name']))->toBe(true);
39
        }
40
    }
41
}
42