Completed
Push — master ( 71b70e...42cf72 )
by Kamil
19:08
created

it_logs_in_user_with_given_credentials()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 7
rs 9.4285
cc 1
eloc 4
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 spec\Sylius\Behat\Context\Ui;
13
14
use Behat\Behat\Context\Context;
15
use PhpSpec\ObjectBehavior;
16
use Sylius\Behat\Page\User\LoginPage;
17
18
/**
19
 * @author Mateusz Zalewski <[email protected]>
20
 */
21
class UserContextSpec extends ObjectBehavior
22
{
23
    function let(LoginPage $loginPage)
24
    {
25
        $this->beConstructedWith($loginPage);
26
    }
27
28
    function it_is_initializable()
29
    {
30
        $this->shouldHaveType('Sylius\Behat\Context\Ui\UserContext');
31
    }
32
33
    function it_implements_context_interface()
34
    {
35
        $this->shouldImplement(Context::class);
36
    }
37
38
    function it_logs_in_user_with_given_credentials($loginPage)
39
    {
40
        $loginPage->open()->shouldBeCalled();
41
        $loginPage->logIn('[email protected]', 'password123')->shouldBeCalled();
42
43
        $this->iLogInAs('[email protected]', 'password123');
44
    }
45
}
46