|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* |
|
4
|
|
|
* @copyright (c) 2013 phpBB Group |
|
5
|
|
|
* @license http://opensource.org/licenses/gpl-3.0.php GNU General Public License v3 |
|
6
|
|
|
* @author MichaelC |
|
7
|
|
|
* |
|
8
|
|
|
*/ |
|
9
|
|
|
|
|
10
|
|
|
namespace AppBundle\Tests\Controller; |
|
11
|
|
|
|
|
12
|
|
|
use AppBundle\Tests\Controller; |
|
13
|
|
|
|
|
14
|
|
|
class AboutControllerTest extends BootstrapTestSuite |
|
15
|
|
|
{ |
|
16
|
|
|
public function testAboutMain() |
|
17
|
|
|
{ |
|
18
|
|
|
$objs = $this->setupTest('/about/'); |
|
19
|
|
|
$crawler = $objs['crawler']; |
|
20
|
|
|
|
|
21
|
|
|
// Title Check |
|
22
|
|
|
$this->assertTrue(strpos(($crawler->filter('title')->first()->text()), 'About phpBB') !== false, 'Title contains About phpBB'); |
|
23
|
|
|
|
|
24
|
|
|
// Content Check |
|
25
|
|
|
$this->assertTrue($crawler->filter('html:contains("Millions of people use phpBB on a daily basis, making it the most widely used open source bulletin board system in the world.")')->count() > 0, 'About Home Content Check'); |
|
26
|
|
|
$this->assertTrue($crawler->filter('a:contains("The History")')->count() > 0, 'About Home Sidebar Check'); |
|
27
|
|
|
$this->assertTrue($crawler->filter('html:contains("Project External Links")')->count() > 0, 'About Home Sidebar Check 2'); |
|
28
|
|
|
|
|
29
|
|
|
// Standard All Page Checks |
|
30
|
|
|
$this->globalTests(); |
|
31
|
|
|
} |
|
32
|
|
|
|
|
33
|
|
|
public function testAboutHistory() |
|
34
|
|
|
{ |
|
35
|
|
|
$objs = $this->setupTest('/about/history/'); |
|
36
|
|
|
$crawler = $objs['crawler']; |
|
37
|
|
|
|
|
38
|
|
|
// Title Check |
|
39
|
|
|
$this->assertTrue(strpos(($crawler->filter('title')->first()->text()), 'History') !== false, 'Title contains About phpBB'); |
|
40
|
|
|
|
|
41
|
|
|
// Content Check |
|
42
|
|
|
$this->assertTrue($crawler->filter('html:contains("phpBB was born as an open-source")')->count() > 0, 'About History Content Check'); |
|
43
|
|
|
$this->assertTrue($crawler->filter('a:contains("Logos")')->count() > 0, 'About Home Sidebar Check'); |
|
44
|
|
|
|
|
45
|
|
|
// Standard All Page Checks |
|
46
|
|
|
$this->globalTests(); |
|
47
|
|
|
} |
|
48
|
|
|
|
|
49
|
|
|
public function testAboutAdvertise() |
|
50
|
|
|
{ |
|
51
|
|
|
$objs = $this->setupTest('/about/advertise/'); |
|
52
|
|
|
$crawler = $objs['crawler']; |
|
53
|
|
|
|
|
54
|
|
|
// Title Check |
|
55
|
|
|
$this->assertTrue(strpos(($crawler->filter('title')->first()->text()), 'Advertise with phpbb.com') !== false, 'Title contains About phpBB'); |
|
56
|
|
|
|
|
57
|
|
|
// Content Check |
|
58
|
|
|
$this->assertTrue($crawler->filter('html:contains("Static (non-rotating) text ads are possibly")')->count() > 0, 'About History Content Check'); |
|
59
|
|
|
$this->assertTrue($crawler->filter('a:contains("Logos")')->count() > 0, 'About Home Sidebar Check'); |
|
60
|
|
|
$this->assertTrue($crawler->filter('html:contains("ready to order advertising on phpBB.com")')->count() > 0, 'About History Content Check 2'); |
|
61
|
|
|
$this->assertTrue($crawler->filter('html:contains("You may cancel your advertising with phpBB.com at any time")')->count() > 0, 'About History Content Check 3'); |
|
62
|
|
|
|
|
63
|
|
|
// Standard All Page Checks |
|
64
|
|
|
$this->globalTests(); |
|
65
|
|
|
} |
|
66
|
|
|
|
|
67
|
|
|
public function testGetInvolved() |
|
68
|
|
|
{ |
|
69
|
|
|
$objs = $this->setupTest('/get-involved/'); |
|
70
|
|
|
$crawler = $objs['crawler']; |
|
71
|
|
|
|
|
72
|
|
|
// Title Check |
|
73
|
|
|
$this->assertTrue(strpos(($crawler->filter('title')->first()->text()), 'Get Involved with phpBB') !== false, 'Title contains Get Involved with phpBB'); |
|
74
|
|
|
|
|
75
|
|
|
// Content Check |
|
76
|
|
|
$this->assertTrue($crawler->filter('html:contains("Think you can help us with something not listed here or specific to the individual teams?")')->count() > 0, 'Get Involved Content Check'); |
|
77
|
|
|
$this->assertTrue($crawler->filter('a:contains("Logos")')->count() > 0, 'About Home Sidebar Check'); |
|
78
|
|
|
$this->assertTrue($crawler->filter('html:contains("Suggest changes and features")')->count() > 0, 'Get Involved Content Check 2'); |
|
79
|
|
|
$this->assertTrue($crawler->filter('a:contains("apply here")')->count() > 0, 'Get Involved Content Check 3'); |
|
80
|
|
|
|
|
81
|
|
|
// Standard All Page Checks |
|
82
|
|
|
$this->globalTests(); |
|
83
|
|
|
} |
|
84
|
|
|
|
|
85
|
|
|
/* |
|
86
|
|
|
public function testGetInvolvedRedirects() |
|
87
|
|
|
{ |
|
88
|
|
|
$objs = $this->setupTest('/about/get-involved/'); |
|
89
|
|
|
$crawler = $objs['crawler']; |
|
90
|
|
|
|
|
91
|
|
|
$this->assertEquals('301', $this->response->getStatusCode(), 'About Get Involved Redirect'); |
|
92
|
|
|
|
|
93
|
|
|
// Unset those so we can combine the two tests into one. |
|
94
|
|
|
unset($objs, $crawler); |
|
95
|
|
|
|
|
96
|
|
|
$objs = $this->setupTest('/development/about/get-involved/'); |
|
97
|
|
|
$crawler = $objs['crawler']; |
|
98
|
|
|
|
|
99
|
|
|
$this->assertEquals('301', $this->response->getStatusCode(), 'Development Get Involved Redirect'); |
|
100
|
|
|
}*/ |
|
101
|
|
|
|
|
102
|
|
|
public function testContactMain() |
|
103
|
|
|
{ |
|
104
|
|
|
$objs = $this->setupTest('/about/contact/'); |
|
105
|
|
|
$crawler = $objs['crawler']; |
|
106
|
|
|
|
|
107
|
|
|
// Title Check |
|
108
|
|
|
$this->assertTrue(strpos(($crawler->filter('title')->first()->text()), 'Contact phpBB') !== false, 'Title contains Contact phpBB(R)'); |
|
109
|
|
|
|
|
110
|
|
|
// Content Check |
|
111
|
|
|
$this->assertTrue($crawler->filter('html:contains("Who to contact concerning non-phpbb.com boards ")')->count() > 0, 'Contact Content Check'); |
|
112
|
|
|
$this->assertTrue($crawler->filter('a:contains("Logos")')->count() > 0, 'Contact Sidebar Check'); |
|
113
|
|
|
|
|
114
|
|
|
// Standard All Page Checks |
|
115
|
|
|
$this->globalTests(); |
|
116
|
|
|
|
|
117
|
|
|
// @TODO Test redirect for /about/contact_us.php |
|
118
|
|
|
} |
|
119
|
|
|
|
|
120
|
|
|
public function testFeaturesMain() |
|
121
|
|
|
{ |
|
122
|
|
|
$objs = $this->setupTest('/about/features/'); |
|
123
|
|
|
$crawler = $objs['crawler']; |
|
124
|
|
|
|
|
125
|
|
|
// Title Check |
|
126
|
|
|
$this->assertTrue(strpos(($crawler->filter('title')->first()->text()), 'Features') !== false, 'Title contains Features'); |
|
127
|
|
|
|
|
128
|
|
|
// Content Check |
|
129
|
|
|
$this->assertTrue($crawler->filter('html:contains("is now in its third major version. Version 3")')->count() > 0, 'Feature Page Content Check'); |
|
130
|
|
|
|
|
131
|
|
|
// Standard All Page Checks |
|
132
|
|
|
$this->globalTests(); |
|
133
|
|
|
} |
|
134
|
|
|
|
|
135
|
|
|
public function testLaunch() |
|
136
|
|
|
{ |
|
137
|
|
|
$this->setupTest('/about/launch/'); |
|
138
|
|
|
|
|
139
|
|
|
// Standard All Page Checks |
|
140
|
|
|
$this->globalTests(); |
|
141
|
|
|
} |
|
142
|
|
|
} |
|
143
|
|
|
|