Completed
Push — master ( b716f1...2f9340 )
by Kamil
18:43
created

SecurityContext::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 4
rs 10
c 1
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
/*
4
 * This file is part of the Sylius package.
5
 *
6
 * (c) Paweł Jędrzejewski
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Sylius\Behat\Context\Setup;
13
14
use Behat\Behat\Context\Context;
15
use Behat\Mink\Mink;
16
use Behat\MinkExtension\Context\MinkAwareContext;
17
use Sylius\Bundle\CoreBundle\Test\Services\SecurityServiceInterface;
18
19
/**
20
 * @author Arkadiusz Krakowiak <[email protected]>
21
 */
22
final class SecurityContext implements Context, MinkAwareContext
23
{
24
    /**
25
     * @var SecurityServiceInterface
26
     */
27
    private $securityService;
28
29
    /**
30
     * @var Mink
31
     */
32
    private $mink;
33
34
    /**
35
     * @param SecurityServiceInterface $securityService
36
     */
37
    public function __construct(SecurityServiceInterface $securityService)
38
    {
39
        $this->securityService = $securityService;
40
    }
41
42
    /**
43
     * @Given I am logged in as :email
44
     */
45
    public function iAmLoggedInAs($email)
46
    {
47
        $this->securityService->logIn($email, 'main', $this->mink->getSession());
48
    }
49
50
    /**
51
     * {@inheritdoc}
52
     */
53
    public function setMink(Mink $mink)
54
    {
55
        $this->mink = $mink;
56
    }
57
58
    /**
59
     * {@inheritdoc}
60
     */
61
    public function setMinkParameters(array $parameters)
62
    {
63
    }
64
}
65