AuthenticationCest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A _before() 0 4 1
A formExists() 0 8 1
A loginWithUsername() 0 5 1
A loginWithId() 0 5 1
1
<?php
2
namespace AppBundle;
3
4
use AppBundle\FunctionalTester;
5
use AppBundle\Page\LoginPage;
6
7
class AuthenticationCest
8
{
9
    public function _before(FunctionalTester $I)
10
    {
11
        $I->followRedirects(false);
12
    }
13
14
    public function formExists(FunctionalTester $I)
15
    {
16
        $I->amOnRoute(LoginPage::$route);
17
        $I->seeElement(LoginPage::$formSelector);
18
        $I->seeElement(LoginPage::$usernameFieldId);
19
        $I->seeElement(LoginPage::$passwordFieldId);
20
        $I->seeElement(LoginPage::$submitButtonId);
21
    }
22
23
    public function loginWithUsername(FunctionalTester $I, LoginPage $loginPage)
24
    {
25
        $loginPage->login('tester', 'password');
26
        $I->seeIsGranted('IS_AUTHENTICATED_FULLY');
27
    }
28
29
    public function loginWithId(FunctionalTester $I, LoginPage $loginPage)
30
    {
31
        $loginPage->login(1000, 'password', 'id');
32
        $I->seeIsGranted('IS_AUTHENTICATED_FULLY');
33
    }
34
}
35