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

UserContextSpec   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 25
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A let() 0 4 1
A it_is_initializable() 0 4 1
A it_implements_context_interface() 0 4 1
A it_logs_in_user_with_given_credentials() 0 7 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