Test Failed
Branch devel (807472)
by Litera
06:16
created

BlockCest::it_should_update_simple_block()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
class BlockCest extends CestCase
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
4
{
5
6
	private $simpleBlock = [
7
		'fields' => [
8
			'name'			=> 'testing block',
9
		],
10
		'options' => [
11
			'day'			=> 'sobota',
12
			'start_hour'	=> '10',
13
			'end_hour'		=> '12',
14
			'start_minute'	=> '15',
15
			'end_minute'	=> '30',
16
		],
17
	];
18
19
	private $fullBlock = [
20
		'fields' => [
21
			'name'			=> 'testing block',
22
			"//textarea[@name='description']"	=> 'testování',
23
			'tutor'			=> 'Tester Testovič',
24
			'email'			=> '[email protected]',
25
			'capacity'		=> 1,
26
		],
27
		'options' => [
28
			'day'			=> 'sobota',
29
			'start_hour'	=> '10',
30
			'end_hour'		=> '12',
31
			'start_minute'	=> '15',
32
			'end_minute'	=> '30',
33
			'program'		=> 1,
34
			'display_progs'	=> 0,
35
			'category'		=> 1,
36
		],
37
	];
38
39
	public function _before(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...
40
	{
41
		$I->wantTo('login to admin');
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
	}
51
52
	public function _after(AcceptanceTester $I)
0 ignored issues
show
Unused Code introduced by
The parameter $I is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

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...
53
	{
54
	}
55
56
	// tests
57
	public function ensure_that_blocks_works(\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...
Coding Style introduced by
This method is not in camel caps format.

This check looks for method names that are not 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 seeker becomes databaseConnectionSeeker.

Loading history...
58
	{
59
		$I->wantTo('Ensure that blocks works');
60
		$I->amOnPage('/srazvs/block/');
61
		$I->see('Správa bloků');
62
	}
63
64
	public function ensure_that_creating_works(\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...
Coding Style introduced by
This method is not in camel caps format.

This check looks for method names that are not 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 seeker becomes databaseConnectionSeeker.

Loading history...
65
	{
66
		$I->wantTo('Ensure that blocks creating works');
67
		$I->amOnPage('/srazvs/block/');
68
		$I->see('Správa bloků');
69
		$I->click('NOVÝ BLOK');
70
		$I->see('nový blok');
71
		$I->see('Název:');
72
		$I->see('Den:');
73
		$I->see('Od:');
74
		$I->see('Do:');
75
		$I->see('Popis:');
76
		$I->see('Lektor:');
77
		$I->see('E-mail:');
78
		$I->see('Programový blok:');
79
		$I->see('Nezobrazovat programy:');
80
		$I->see('Kapacita:');
81
		$I->see('Kategorie:');
82
	}
83
84 View Code Duplication
	public function it_should_create_simple_block(\AcceptanceTester $I)
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...
Coding Style introduced by
This method is not in camel caps format.

This check looks for method names that are not 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 seeker becomes databaseConnectionSeeker.

Loading history...
85
	{
86
		$I->amOnPage('/srazvs/block/');
87
		$I->see('Správa bloků');
88
		$I->wantTo('Create new block with basic data');
89
		$I->click('NOVÝ BLOK', '#content');
90
		$I->seeCurrentUrlMatches('~/srazvs/block/new~');
91
		$this->fillForm($I, $this->simpleBlock);
92
		$I->click('Uložit', '#content');
93
		$I->seeInCurrentUrl('/srazvs/block');
94
	}
95
96
	public function it_should_update_simple_block(\AcceptanceTester $I)
0 ignored issues
show
Unused Code introduced by
The parameter $I is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

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...
Coding Style introduced by
This method is not in camel caps format.

This check looks for method names that are not 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 seeker becomes databaseConnectionSeeker.

Loading history...
97
	{
98
	}
99
100 View Code Duplication
	public function it_should_create_full_block(\AcceptanceTester $I)
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...
Coding Style introduced by
This method is not in camel caps format.

This check looks for method names that are not 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 seeker becomes databaseConnectionSeeker.

Loading history...
101
	{
102
		$I->amOnPage('/srazvs/block/');
103
		$I->see('Správa bloků');
104
		$I->wantTo('Create new block with all data');
105
		$I->click('NOVÝ BLOK', '#content');
106
		$I->seeCurrentUrlMatches('~/srazvs/block/new~');
107
		$this->fillForm($I, $this->fullBlock);
108
		$I->click('Uložit', '#content');
109
		$I->seeInCurrentUrl('/srazvs/block?error=ok');
110
	}
111
112
	public function it_should_update_full_block(\AcceptanceTester $I)
0 ignored issues
show
Unused Code introduced by
The parameter $I is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

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...
Coding Style introduced by
This method is not in camel caps format.

This check looks for method names that are not 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 seeker becomes databaseConnectionSeeker.

Loading history...
113
	{
114
	}
115
116
}
117