Completed
Push — master ( 773e86...671deb )
by
unknown
19s queued 12s
created

testStylesSubmissionPolicy30x()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 15
rs 9.4285
cc 1
eloc 7
nc 1
nop 0
1
<?php
2
/**
3
 *
4
 * @copyright (c) 2014 phpBB Group
5
 * @license http://opensource.org/licenses/gpl-3.0.php GNU General Public License v3
6
 * @author PayBas
7
 *
8
 */
9
10
namespace AppBundle\Tests\Controller;
11
12
use AppBundle\Tests\Controller;
13
14
class StylesControllerTest extends BootstrapTestSuite
15
{
16
	public function testStylesMain()
17
	{
18
		$objs	= $this->setupTest('/styles/');
19
		$crawler = $objs['crawler'];
20
21
		// Title Check
22
		$this->assertTrue(strpos(($crawler->filter('title')->first()->text()), 'Styles') !== false, 'Title contains Styles');
23
24
		// Content Check
25
		$this->assertTrue($crawler->filter('html:contains("The default style for phpBB 3.1.x and 3.2.x is prosilver")')->count() > 0, 'Styles Home Content Check');
26
		$this->assertTrue($crawler->filter('html:contains("Styles Forums")')->count() > 0, 'Styles Sidebar Check');
27
28
		// Standard All Page Checks
29
		$this->globalTests();
30
	}
31
32
	public function testStylesSupport()
33
	{
34
		$objs	= $this->setupTest('/styles/support/');
35
		$crawler = $objs['crawler'];
36
37
		// Title Check
38
		$this->assertTrue(strpos(($crawler->filter('title')->first()->text()), 'Styles Support') !== false, 'Title contains Styles Support');
39
40
		// Content Check
41
		$this->assertTrue($crawler->filter('html:contains("Where can I find styles?")')->count() > 0, 'Styles Support Content Check');
42
		$this->assertTrue($crawler->filter('html:contains("Styles Forums")')->count() > 0, 'Styles Sidebar Check');
43
44
		// Standard All Page Checks
45
		$this->globalTests();
46
	}
47
48
	public function testStylesInstalling()
49
	{
50
		$objs	= $this->setupTest('/styles/installing/');
51
		$crawler = $objs['crawler'];
52
53
		// Title Check
54
		$expectedTitle = array('Installing', 'Using Styles');
55
56
		$this->assertTrue(strpos(($crawler->filter('title')->first()->text()), $expectedTitle[0]) !== false, 'Title contains Installing');
57
		$this->assertTrue(strpos(($crawler->filter('title')->first()->text()), $expectedTitle[1]) !== false, 'Title contains Using Styles');
58
59
		// Content Check
60
		$this->assertTrue($crawler->filter('html:contains("the process of installing and using styles")')->count() > 0, 'Styles Installing Content Check');
61
		$this->assertTrue($crawler->filter('html:contains("Styles Forums")')->count() > 0, 'Styles Sidebar Check');
62
63
		// Standard All Page Checks
64
		$this->globalTests();
65
	}
66
67
	public function testStylesCreate()
68
	{
69
		$objs	= $this->setupTest('/styles/create/');
70
		$crawler = $objs['crawler'];
71
72
		// Title Check
73
		$expectedTitle = array('Creating', 'Modifying Styles');
74
75
		$this->assertTrue(strpos(($crawler->filter('title')->first()->text()), $expectedTitle[0]) !== false, 'Title contains Creating');
76
		$this->assertTrue(strpos(($crawler->filter('title')->first()->text()), $expectedTitle[1]) !== false, 'Title contains Modifying Styles');
77
78
		// Content Check
79
		$this->assertTrue($crawler->filter('html:contains("creating your own style for phpBB 3.2.x/3.1.x")')->count() > 0, 'Styles Create Content Check');
80
		$this->assertTrue($crawler->filter('html:contains("Styles Forums")')->count() > 0, 'Styles Sidebar Check');
81
82
		// Standard All Page Checks
83
		$this->globalTests();
84
	}
85
86
	public function testStylesTeamOverview()
87
	{
88
		$objs	= $this->setupTest('/styles/team-overview/');
89
		$crawler = $objs['crawler'];
90
91
		// Title Check
92
		$this->assertTrue(strpos(($crawler->filter('title')->first()->text()), 'Style Customisations Team Overview') !== false, 'Style Customisations Team Overview');
93
94
		// Content Check
95
		$this->assertTrue($crawler->filter('html:contains("The Style Customisations Team oversees all activities on phpBB.com")')->count() > 0, 'Style Customisations Team Overview Content Check');
96
		$this->assertTrue($crawler->filter('html:contains("Styles Forums")')->count() > 0, 'Styles Sidebar Check');
97
98
		// Standard All Page Checks
99
		$this->globalTests();
100
	}
101
102
	public function testStylesJuniorValidators()
103
	{
104
		$objs	= $this->setupTest('/styles/junior-validators/');
105
		$crawler = $objs['crawler'];
106
107
		// Title Check
108
		$this->assertTrue(strpos(($crawler->filter('title')->first()->text()), 'Junior Validators') !== false, 'Title contains Junior Validators');
109
110
		// Content Check
111
		$this->assertTrue($crawler->filter('html:contains("The Junior Style Validators Team is composed of community members")')->count() > 0, 'Junior Validators Content Check');
112
		$this->assertTrue($crawler->filter('html:contains("Styles Forums")')->count() > 0, 'Styles Sidebar Check');
113
114
		// Standard All Page Checks
115
		$this->globalTests();
116
	}
117
118
	public function testStylesRulesPolicies()
119
	{
120
		$objs	= $this->setupTest('/styles/rules-and-policies/');
121
		$crawler = $objs['crawler'];
122
123
		// Title Check
124
		$expectedTitle = array('Styles Rules', 'Policies');
125
126
		$this->assertTrue(strpos(($crawler->filter('title')->first()->text()), $expectedTitle[0]) !== false, 'Title contains Styles Rules');
127
		$this->assertTrue(strpos(($crawler->filter('title')->first()->text()), $expectedTitle[1]) !== false, 'Title contains Policies');
128
129
		// Content Check
130
		$this->assertTrue($crawler->filter('html:contains("phpBB.com Styles Rules, Policies and Guidelines")')->count() > 0, 'Styles Rules and Policies Content Check');
131
		$this->assertTrue($crawler->filter('html:contains("Styles Forums")')->count() > 0, 'Styles Sidebar Check');
132
133
		// Standard All Page Checks
134
		$this->globalTests();
135
	}
136
137
	public function testStylesSubmissionPolicy32x()
138
	{
139
		$objs	= $this->setupTest('/styles/rules-and-policies/submission-policy/3.2/');
140
		$crawler = $objs['crawler'];
141
142
		// Title Check
143
		$this->assertTrue(strpos(($crawler->filter('title')->first()->text()), 'Styles Submission Policy (3.2.x)') !== false, 'Title contains Styles Submission Policy (3.2.x)');
144
145
		// Content Check
146
		$this->assertTrue($crawler->filter('html:contains("this Styles Submission Policy page is dedicated to styles for phpBB 3.2.x")')->count() > 0, 'Submission Policy 3.2.x Content Check');
147
		$this->assertTrue($crawler->filter('html:contains("Styles Forums")')->count() > 0, 'Styles Sidebar Check');
148
149
		// Standard All Page Checks
150
		$this->globalTests();
151
	}
152
153
	public function testStylesSubmissionPolicy31x()
154
	{
155
		$objs	= $this->setupTest('/styles/rules-and-policies/submission-policy/3.1/');
156
		$crawler = $objs['crawler'];
157
158
		// Title Check
159
		$this->assertTrue(strpos(($crawler->filter('title')->first()->text()), 'Styles Submission Policy (3.1.x)') !== false, 'Title contains Styles Submission Policy (3.1.x)');
160
161
		// Content Check
162
		$this->assertTrue($crawler->filter('html:contains("this Styles Submission Policy page is dedicated to styles for phpBB 3.1.x")')->count() > 0, 'Submission Policy 3.1.x Content Check');
163
		$this->assertTrue($crawler->filter('html:contains("Styles Forums")')->count() > 0, 'Styles Sidebar Check');
164
165
		// Standard All Page Checks
166
		$this->globalTests();
167
	}
168
169
	public function testStylesSubmissionPolicy30x()
170
	{
171
		$objs	= $this->setupTest('/styles/rules-and-policies/submission-policy/3.0/');
172
		$crawler = $objs['crawler'];
173
174
		// Title Check
175
		$this->assertTrue(strpos(($crawler->filter('title')->first()->text()), 'Styles Submission Policy (3.0.x)') !== false, 'Title contains Styles Submission Policy (3.0.x)');
176
177
		// Content Check
178
		$this->assertTrue($crawler->filter('html:contains("this Styles Submission Policy page is dedicated to styles for phpBB 3.0.x")')->count() > 0, 'Submission Policy 3.0.x Content Check');
179
		$this->assertTrue($crawler->filter('html:contains("Styles Forums")')->count() > 0, 'Styles Sidebar Check');
180
181
		// Standard All Page Checks
182
		$this->globalTests();
183
	}
184
185
	public function testStylesDemo()
186
	{
187
		$objs	= $this->setupTest('/styles/demo/');
188
		$crawler = $objs['crawler'];
189
190
		// Title Check
191
		$this->assertTrue(strpos(($crawler->filter('title')->first()->text()), 'Styles Demo') !== false, 'Title contains Styles Demo');
192
193
		// Content Check
194
		$this->assertTrue($crawler->filter('html:contains("Here are live demos for the phpBB board styles")')->count() > 0, 'Styles Demo Content Check');
195
		$this->assertTrue($crawler->filter('html:contains("Styles Forums")')->count() > 0, 'Styles Sidebar Check');
196
197
		// Standard All Page Checks
198
		$this->globalTests();
199
	}
200
201
	public function testStylesDemoNotReady()
202
	{
203
		$objs	= $this->setupTest('/styles/demo/3.1/');
204
		$crawler = $objs['crawler'];
205
206
		// Title Check
207
		$this->assertTrue(strpos(($crawler->filter('title')->first()->text()), 'Styles Demo') !== false, 'Title contains Styles Demo');
208
209
		// Content Check
210
		$this->assertTrue($crawler->filter('html:contains("accepting styles")')->count() > 0, 'Styles Demo Content Check');
211
		$this->assertTrue($crawler->filter('html:contains("Styles Forums")')->count() > 0, 'Styles Sidebar Check');
212
213
		// Standard All Page Checks
214
		$this->globalTests();
215
	}
216
}
217