CestCase::logIn()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 10
nc 1
nop 1
dl 0
loc 14
rs 9.4285
c 0
b 0
f 0
1
<?php
2
// Here you can initialize variables that will be available to your tests
3
4
/**
5
* Default cest case
6
*/
7
class CestCase
8
{
9
10 View Code Duplication
	protected function fillForm(\AcceptanceTester $I, array $formData)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
Coding Style Naming introduced by
The parameter $I is not named in camelCase.

This check marks parameter names that have not been written in camelCase.

In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. Thus the name database connection string becomes databaseConnectionString.

Loading history...
11
	{
12
		if(array_key_exists('fields', $formData)) {
13
			foreach($formData['fields'] as $field => $value) {
14
				$I->fillField($field, $value);
15
			}
16
		}
17
18
		if(array_key_exists('options', $formData)) {
19
			foreach($formData['options'] as $option => $value) {
20
				$I->selectOption($option, $value);
21
			}
22
		}
23
	}
24
25 View Code Duplication
	protected function seeInForm(\AcceptanceTester $I, array $formData)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
Coding Style Naming introduced by
The parameter $I is not named in camelCase.

This check marks parameter names that have not been written in camelCase.

In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. Thus the name database connection string becomes databaseConnectionString.

Loading history...
26
	{
27
		if(array_key_exists('fields', $formData)) {
28
			foreach($formData['fields'] as $field => $value) {
29
				$I->seeInField($field, $value);
30
			}
31
		}
32
33
		if(array_key_exists('options', $formData)) {
34
			foreach($formData['options'] as $option => $value) {
35
				$I->seeOptionIsSelected($option, $value);
36
			}
37
		}
38
	}
39
40
	protected function logIn(\AcceptanceTester $I)
0 ignored issues
show
Coding Style Naming introduced by
The parameter $I is not named in camelCase.

This check marks parameter names that have not been written in camelCase.

In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. Thus the name database connection string becomes databaseConnectionString.

Loading history...
41
	{
42
		$I->amOnPage('admin/');
43
		$I->seeInCurrentUrl('admin/');
44
		$I->fillField('username','tester');
45
		$I->fillField('password','tester');
46
		$I->checkOption('persistent');
47
		$I->click('Přihlásit', '#content');
48
		$I->see('Úvod');
49
		$I->see('tester');
50
		//$this->cookie = $I->grabCookie('vodni.skauting.local');
51
52
		return $I;
53
	}
54
55
}
56