Passed
Push — master ( ad0ec6...39c00e )
by Matthew
06:23 queued 02:14
created
www/includes/easyparliament/templates/html/user/join.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -110,7 +110,7 @@
 block discarded – undo
110 110
 
111 111
                 <div class="row">
112 112
                 <span class="formw"><input type="radio" name="<?= $optin_key ?>" id="<?= $optin_key ?>true" value="true" <?= $optin_value == 'Yes' ? ' checked' : '' ?>> <label class="option_yesno" for="<?= $optin_key ?>true">Yes</label><br>
113
-                <input type="radio" name="<?= $optin_key ?>" id="<?= $optin_key ?>false" value="false" <?= $optin_value == 'No' ? ' checked' :  !isset($mp_alert) ? ' checked' : '' ?>> <label class="option_yesno"  for="<?= $optin_key ?>false">No</label></span>
113
+                <input type="radio" name="<?= $optin_key ?>" id="<?= $optin_key ?>false" value="false" <?= $optin_value == 'No' ? ' checked' : !isset($mp_alert) ? ' checked' : '' ?>> <label class="option_yesno"  for="<?= $optin_key ?>false">No</label></span>
114 114
                 </div>
115 115
 
116 116
                 <?php } ?>
Please login to merge, or discard this patch.
classes/Renderer/User.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
         }
42 42
     }
43 43
 
44
-    private function AddLangSwitcher(){
44
+    private function AddLangSwitcher() {
45 45
         if (preg_match('#^(senedd|wales|ms(?!p))#', $this->page)) {
46 46
             $href = $_SERVER['REQUEST_URI'];
47 47
             if (LANGUAGE == 'cy') {
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
         $menudata   = $this->pagedata->page_metadata('userviewself', 'menu');
70 70
         $edittitle  = $menudata['title'];
71 71
         $EDITURL    = new \MySociety\TheyWorkForYou\Url('userviewself');
72
-        if ($this->page == 'userviewself' || $this->page == 'useredit' ) {
72
+        if ($this->page == 'userviewself' || $this->page == 'useredit') {
73 73
             $editclass = 'on';
74 74
         } else {
75 75
             $editclass = '';
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
         // The 'Log out' link.
79 79
         $menudata   = $this->pagedata->page_metadata('userlogout', 'menu');
80 80
         $logouttext = $menudata['text'];
81
-        $logouttitle= $menudata['title'];
81
+        $logouttitle = $menudata['title'];
82 82
 
83 83
         $LOGOUTURL  = new \MySociety\TheyWorkForYou\Url('userlogout');
84 84
         if ($this->page != 'userlogout') {
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/mp/divisions.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
         <div class="person-panels">
17 17
             <div class="sidebar__unit in-page-nav">
18 18
                 <div>
19
-                    <?php if ( isset($policydivisions) && $policydivisions && count($policydivisions) == 1 ) { ?>
19
+                    <?php if (isset($policydivisions) && $policydivisions && count($policydivisions) == 1) { ?>
20 20
                         <p class="policy-votes-intro">
21 21
                             How <?= $full_name ?> voted on <?= $policydivisions[array_keys($policydivisions)[0]]['desc'] ?>.
22 22
                         </p>
@@ -63,11 +63,11 @@  discard block
 block discarded – undo
63 63
 
64 64
                             <?php
65 65
                                 # a header dict is used to give human information about the specific policy
66
-                                if ( isset($policy['header']) ) { ?>
66
+                                if (isset($policy['header'])) { ?>
67 67
                                 <div class="panel policy-votes-hero" style="background-image: url('<?php echo $policy['header']['image']; ?>');">
68 68
                                     <h2><?php echo $policy['header']['title']; ?></h2>
69 69
                                     <p><?php echo $policy['header']['description']; ?>.</p>
70
-                                    <?php if ( $policy['header']['image_source'] ) { ?>
70
+                                    <?php if ($policy['header']['image_source']) { ?>
71 71
                                     <span class="policy-votes-hero__image-attribution">
72 72
                                         Photo:
73 73
                                         <a href="<?php echo $policy['header']['image_source']; ?>">
@@ -83,9 +83,9 @@  discard block
 block discarded – undo
83 83
 
84 84
                             <?php
85 85
                                 # display the calculated position for the policy on this page
86
-                                if ( isset($policy['position']) ) { ?>
86
+                                if (isset($policy['position'])) { ?>
87 87
                                 <div class="panel">
88
-                                    <?php if ( $policy['position']['has_strong'] ) { ?>
88
+                                    <?php if ($policy['position']['has_strong']) { ?>
89 89
                                         <h3 class="policy-vote-overall-stance">
90 90
                                             <?= $full_name . ' ' . $policy['position']['desc'] ?>
91 91
                                         </h3>
Please login to merge, or discard this patch.
classes/Memcache.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -29,9 +29,9 @@  discard block
 block discarded – undo
29 29
             return;
30 30
         }
31 31
         if (class_exists('\Memcached')) {
32
-            self::$memcache->set(OPTION_TWFY_DB_NAME.':'.$key, $value, $timeout);
32
+            self::$memcache->set(OPTION_TWFY_DB_NAME . ':' . $key, $value, $timeout);
33 33
         } else {
34
-            self::$memcache->set(OPTION_TWFY_DB_NAME.':'.$key, $value, MEMCACHE_COMPRESSED, $timeout);
34
+            self::$memcache->set(OPTION_TWFY_DB_NAME . ':' . $key, $value, MEMCACHE_COMPRESSED, $timeout);
35 35
         }
36 36
     }
37 37
 
@@ -39,9 +39,9 @@  discard block
 block discarded – undo
39 39
         // see http://php.net/manual/en/memcache.get.php#112056 for explanation of this
40 40
         $was_found = false;
41 41
         if (class_exists('\Memcached')) {
42
-            $value = self::$memcache->get(OPTION_TWFY_DB_NAME.':'.$key, null, $was_found);
42
+            $value = self::$memcache->get(OPTION_TWFY_DB_NAME . ':' . $key, null, $was_found);
43 43
         } elseif (class_exists('\Memcache')) {
44
-            $value = self::$memcache->get(OPTION_TWFY_DB_NAME.':'.$key, $was_found);
44
+            $value = self::$memcache->get(OPTION_TWFY_DB_NAME . ':' . $key, $was_found);
45 45
         }
46 46
         if ($was_found === false) {
47 47
             return false; // mmmmm
Please login to merge, or discard this patch.
tests/UserPageTest.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
      */
9 9
     public function getDataSet()
10 10
     {
11
-        return $this->createMySQLXMLDataSet(dirname(__FILE__).'/_fixtures/user.xml');
11
+        return $this->createMySQLXMLDataSet(dirname(__FILE__) . '/_fixtures/user.xml');
12 12
     }
13 13
 
14 14
     private function fetch_page($vars)
@@ -16,14 +16,14 @@  discard block
 block discarded – undo
16 16
         return $this->base_fetch_page($vars, 'user');
17 17
     }
18 18
 
19
-    private function fetch_user_page( $vars = array(), $page = 'user' )
19
+    private function fetch_user_page($vars = array(), $page = 'user')
20 20
     {
21
-        return $this->base_fetch_page_user( $vars, '1.fbb689a0c092f5534b929d302db2c8a9', $page );
21
+        return $this->base_fetch_page_user($vars, '1.fbb689a0c092f5534b929d302db2c8a9', $page);
22 22
     }
23 23
 
24 24
     public function testLoginPageLoads()
25 25
     {
26
-        $page = $this->base_fetch_page( array(), 'user/login' );
26
+        $page = $this->base_fetch_page(array(), 'user/login');
27 27
         $this->assertStringContainsString('Sign in', $page);
28 28
     }
29 29
 
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
             'password' => 'password',
35 35
             'submitted' => 'true',
36 36
         );
37
-        $page = $this->base_fetch_page( $vars, 'user/login' );
37
+        $page = $this->base_fetch_page($vars, 'user/login');
38 38
         # it's a redirect which means we should get nothing
39 39
         # as we're using the cli version of php :(
40 40
         $this->assertEquals('', $page);
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
     public function testEditUserInfo()
51 51
     {
52
-        $page = $this->fetch_user_page( array('pg' => 'edit' ) );
52
+        $page = $this->fetch_user_page(array('pg' => 'edit'));
53 53
         $this->assertStringContainsString('Edit your details', $page);
54 54
         $this->assertStringContainsString('name="pg" value="edit"', $page);
55 55
         $this->assertStringContainsString('value="Test"', $page);
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
             'email' => '[email protected]',
63 63
             'submitted' => 'true',
64 64
         );
65
-        $page = $this->fetch_user_page( $vars );
65
+        $page = $this->fetch_user_page($vars);
66 66
         $this->assertStringContainsString('Example User', $page);
67 67
     }
68 68
 }
Please login to merge, or discard this patch.
tests/UserTest.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
      */
12 12
     public function getDataSet()
13 13
     {
14
-        return $this->createMySQLXMLDataSet(dirname(__FILE__).'/_fixtures/user.xml');
14
+        return $this->createMySQLXMLDataSet(dirname(__FILE__) . '/_fixtures/user.xml');
15 15
     }
16 16
 
17 17
     /**
@@ -43,8 +43,8 @@  discard block
 block discarded – undo
43 43
         $id = $u->user_id();
44 44
         $u->init($id);
45 45
 
46
-        $this->assertEquals( 'Test', $u->firstname() );
47
-        $this->assertEquals( 'EH1 99SP', $u->postcode() );
46
+        $this->assertEquals('Test', $u->firstname());
47
+        $this->assertEquals('EH1 99SP', $u->postcode());
48 48
     }
49 49
 
50 50
     public function testEditUser() {
@@ -52,9 +52,9 @@  discard block
 block discarded – undo
52 52
         $u = new THEUSER();
53 53
         $u->loggedin = 1;
54 54
 
55
-        $this->assertEquals( 'Test', $u->firstname() );
55
+        $this->assertEquals('Test', $u->firstname());
56 56
 
57
-        $d = $u->update_self( array(
57
+        $d = $u->update_self(array(
58 58
             'firstname' => 'Experiment',
59 59
             'lastname' => 'User',
60 60
             'postcode' => 'EH1 99SP',
@@ -62,9 +62,9 @@  discard block
 block discarded – undo
62 62
             'url' => '',
63 63
             'optin' => 0,
64 64
             'user_id' => 1
65
-        ) );
65
+        ));
66 66
 
67
-        $this->assertEquals( 'Experiment', $u->firstname() );
67
+        $this->assertEquals('Experiment', $u->firstname());
68 68
     }
69 69
 
70 70
     public function testEditUserEmail() {
@@ -72,9 +72,9 @@  discard block
 block discarded – undo
72 72
         $u = new THEUSER();
73 73
         $u->loggedin = 1;
74 74
 
75
-        $this->assertEquals( '[email protected]', $u->email() );
75
+        $this->assertEquals('[email protected]', $u->email());
76 76
 
77
-        $d = $u->update_self( array(
77
+        $d = $u->update_self(array(
78 78
             'firstname' => 'Experiment',
79 79
             'lastname' => 'User',
80 80
             'email' => '[email protected]',
@@ -83,10 +83,10 @@  discard block
 block discarded – undo
83 83
             'url' => '',
84 84
             'optin' => 0,
85 85
             'user_id' => 1
86
-        ), false );
86
+        ), false);
87 87
 
88 88
         // email should not change as user needs to confirm
89
-        $this->assertEquals( '[email protected]', $u->email() );
89
+        $this->assertEquals('[email protected]', $u->email());
90 90
 
91 91
         $tokenCount = $this->getRowCount('tokens', 'data = "1::[email protected]"');
92 92
         $this->assertEquals(1, $tokenCount, 'correct number of email confirm tokens');
@@ -108,9 +108,9 @@  discard block
 block discarded – undo
108 108
 
109 109
         $token = '2-' . $tokenRow['token'];
110 110
 
111
-        $u->confirm_email($token,false);
111
+        $u->confirm_email($token, false);
112 112
 
113
-        $this->assertEquals( '[email protected]', $u->email(), 'confirming with token updates email address' );
113
+        $this->assertEquals('[email protected]', $u->email(), 'confirming with token updates email address');
114 114
         $tokenCount = $this->getRowCount('tokens', 'data = "1::[email protected]"');
115 115
         $this->assertEquals(0, $tokenCount, 'token deleted once email confirmed');
116 116
 
@@ -126,15 +126,15 @@  discard block
 block discarded – undo
126 126
         $u = new THEUSER();
127 127
         $u->loggedin = 1;
128 128
 
129
-        $this->assertEquals( '[email protected]', $u->email(), 'confirming inital email address' );
129
+        $this->assertEquals('[email protected]', $u->email(), 'confirming inital email address');
130 130
 
131 131
         $tokenCount = $this->getRowCount('tokens', 'data = "1::[email protected]"');
132 132
         $this->assertEquals(1, $tokenCount, 'correct number of email confirm tokens');
133 133
 
134 134
         $token = '2-lkdsjafhsadjhf';
135 135
 
136
-        $u->confirm_email($token,false);
137
-        $this->assertEquals( '[email protected]', $u->email(), 'expired token does not update email address' );
136
+        $u->confirm_email($token, false);
137
+        $this->assertEquals('[email protected]', $u->email(), 'expired token does not update email address');
138 138
 
139 139
         $tokenCount = $this->getRowCount('tokens', 'data = "1::[email protected]"');
140 140
         $this->assertEquals(1, $tokenCount, 'correct number of email confirm tokens');
Please login to merge, or discard this patch.
tests/SearchTest.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,8 +7,8 @@  discard block
 block discarded – undo
7 7
 
8 8
 class SearchTest extends FetchPageTestCase
9 9
 {
10
-	public function setUp(): void
11
-	{
10
+    public function setUp(): void
11
+    {
12 12
         parent::setUp();
13 13
         include_once('www/includes/easyparliament/searchengine.php');
14 14
     }
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
      *
88 88
      * @group xapian
89 89
      */
90
-	public function testSearchNormal()
90
+    public function testSearchNormal()
91 91
     {
92 92
         $SEARCHENGINE = new SEARCHENGINE('test');
93 93
 
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
      *
103 103
      * @group xapian
104 104
      */
105
-	public function testSearchLink()
105
+    public function testSearchLink()
106 106
     {
107 107
         $SEARCHENGINE = new SEARCHENGINE('test');
108 108
 
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -26,11 +26,11 @@  discard block
 block discarded – undo
26 26
     public function testConstituencySearch()
27 27
     {
28 28
         $this->assertEquals(
29
-            array( array( 'Alyn and Deeside' ), false ),
29
+            array(array('Alyn and Deeside'), false),
30 30
             \MySociety\TheyWorkForYou\Utility\Search::searchConstituenciesByQuery('Alyn')
31 31
         );
32 32
         $this->assertEquals(
33
-            array( array( 'Alyn and Deeside' ), false ),
33
+            array(array('Alyn and Deeside'), false),
34 34
             \MySociety\TheyWorkForYou\Utility\Search::searchConstituenciesByQuery('Alyn and Deeside')
35 35
         );
36 36
     }
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
      */
120 120
     public function testSearchPage()
121 121
     {
122
-        $page = $this->fetch_page( array( ) );
122
+        $page = $this->fetch_page(array( ));
123 123
         $this->assertStringContainsString('Search', $page);
124 124
     }
125 125
 
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
      */
131 131
     public function testSearchPageMP()
132 132
     {
133
-        $page = $this->fetch_page( array( 'q' => 'Mary Smith' ) );
133
+        $page = $this->fetch_page(array('q' => 'Mary Smith'));
134 134
         $this->assertStringContainsString('Mary Smith', $page);
135 135
         $this->assertStringContainsString('MP, Amber Valley', $page);
136 136
     }
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
      */
143 143
     public function testSearchPageMultipleMP()
144 144
     {
145
-        $page = $this->fetch_page( array( 'q' => 'Jones' ) );
145
+        $page = $this->fetch_page(array('q' => 'Jones'));
146 146
         $this->assertStringContainsString('People matching <em class="current-search-term">Jones</em>', $page);
147 147
         $this->assertStringContainsString('Andrew Jones', $page);
148 148
         $this->assertStringContainsString('Simon Jones', $page);
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
      * @group xapian
155 155
      */
156 156
     public function testSearchPageCons() {
157
-        $page = $this->fetch_page( array( 'q' => 'Amber' ) );
157
+        $page = $this->fetch_page(array('q' => 'Amber'));
158 158
         $this->assertStringContainsString('MP for <em class="current-search-term">Amber</em>', $page);
159 159
         $this->assertStringContainsString('Mary Smith', $page);
160 160
     }
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
      * @group xapian
167 167
      */
168 168
     public function testSearchPageConsWithNoMp() {
169
-        $page = $this->fetch_page( array( 'q' => 'Alyn' ) );
169
+        $page = $this->fetch_page(array('q' => 'Alyn'));
170 170
         $this->assertStringNotContainsString('MP for <em class="current-search-term">Alyn</em>', $page);
171 171
         $this->assertStringNotContainsString('MPs in constituencies matching', $page);
172 172
     }
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
      * @group xapian
179 179
      */
180 180
     public function testSearchPageMultipleCons() {
181
-        $page = $this->fetch_page( array( 'q' => 'Liverpool' ) );
181
+        $page = $this->fetch_page(array('q' => 'Liverpool'));
182 182
         $this->assertStringContainsString('MPs in constituencies matching <em class="current-search-term">Liverpool</em>', $page);
183 183
         $this->assertStringContainsString('Susan Brown', $page);
184 184
         $this->assertStringContainsString('MP, Liverpool, Riverside', $page);
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
      * @group xapian
193 193
      */
194 194
     public function testSearchPageGlossary() {
195
-        $page = $this->fetch_page( array( 'q' => 'other place' ) );
195
+        $page = $this->fetch_page(array('q' => 'other place'));
196 196
         $this->assertStringContainsString('Glossary items matching', $page);
197 197
         $this->assertStringContainsString('<a href="/glossary/?gl=1">&ldquo;other place', $page);
198 198
     }
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
      * @group xapian
204 204
      */
205 205
     public function testSearchPageSpellCorrect() {
206
-        $page = $this->fetch_page( array( 'q' => 'plice' ) );
206
+        $page = $this->fetch_page(array('q' => 'plice'));
207 207
         $this->assertStringContainsString('Did you mean <a href="/search/?q=place">place', $page);
208 208
     }
209 209
 
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
      * @group xapian
214 214
      */
215 215
     public function testSearchBySpeakerNoResults() {
216
-        $page = $this->fetch_page( array( 'q' => 'splice', 'o' => 'p' ) );
216
+        $page = $this->fetch_page(array('q' => 'splice', 'o' => 'p'));
217 217
         $this->assertStringContainsString('Who says splice the most', $page);
218 218
         $this->assertStringContainsString('No results', $page);
219 219
     }
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
      * @group xapian
241 241
      */
242 242
     public function testSearchPageRSS() {
243
-        $page = $this->fetch_page( array( 'q' => 'test' ) );
243
+        $page = $this->fetch_page(array('q' => 'test'));
244 244
         $this->assertStringContainsString('<a href="/search/rss/?s=test">get an RSS feed', $page);
245 245
     }
246 246
 
Please login to merge, or discard this patch.
tests/SectionTest.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -20,13 +20,13 @@  discard block
 block discarded – undo
20 20
 
21 21
     public function testDebatesFront() {
22 22
         foreach ($this->types as $type) {
23
-            $this->fetch_page( array( 'type' => $type ) );
23
+            $this->fetch_page(array('type' => $type));
24 24
         }
25 25
     }
26 26
 
27 27
     public function testDebatesYear() {
28 28
         foreach ($this->types as $type) {
29
-            $page = $this->fetch_page( array( 'type' => $type, 'y' => '2014' ) );
29
+            $page = $this->fetch_page(array('type' => $type, 'y' => '2014'));
30 30
             $this->assertStringContainsString('<div class="calendar">', $page);
31 31
             $this->assertStringContainsString('January', $page);
32 32
             $this->assertMatchesRegularExpression('/<td colspan="2">&nbsp;<\/td><td[^>]*><a href="\/' . $type . '\/\?d=2014-01-01">1<\/a><\/td><td[^>]*><span>2<\/span><\/td>/', $page);
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 
36 36
     public function testDebatesDay() {
37 37
         foreach ($this->types as $type) {
38
-            $page = $this->fetch_page( array( 'type' => $type, 'd' => '2014-01-01' ) );
38
+            $page = $this->fetch_page(array('type' => $type, 'd' => '2014-01-01'));
39 39
             $this->assertStringContainsString('Wednesday,  1 January 2014', $page);
40 40
             $this->assertStringContainsString('HeadingA', $page);
41 41
             if ($type == 'wrans') {
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
                 continue;
61 61
             }
62 62
 
63
-            $page = $this->fetch_page( array( 'type' => $type, 'id' => '2014-01-01b.1.1' ) );
63
+            $page = $this->fetch_page(array('type' => $type, 'id' => '2014-01-01b.1.1'));
64 64
             if ($type == 'wrans') {
65 65
                 $this->assertMatchesRegularExpression("#All .*?written answers on  1 Jan 2014#i", $page);
66 66
                 $this->assertStringContainsString("QuestionA", $page);
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 
73 73
     public function testDebatesSubheading() {
74 74
         foreach ($this->types as $type) {
75
-            $page = $this->fetch_page( array( 'type' => $type, 'id' => '2014-01-01b.1.2' ) );
75
+            $page = $this->fetch_page(array('type' => $type, 'id' => '2014-01-01b.1.2'));
76 76
             $this->assertStringContainsString("HeadingA", $page);
77 77
             if ($type == 'spwrans') {
78 78
                 $this->assertStringContainsString("QuestionA", $page);
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 
103 103
     public function testDebatesSpeech() {
104 104
         foreach ($this->types as $type) {
105
-            $page = $this->fetch_page( array( 'type' => $type, 'id' => '2014-01-01b.1.3' ) );
105
+            $page = $this->fetch_page(array('type' => $type, 'id' => '2014-01-01b.1.3'));
106 106
             if ($type == 'wrans' || $type == 'spwrans' || $type == 'wms') {
107 107
                 $this->assertMatchesRegularExpression("#Location: .*?/$type/\?id=2014-01-01b\.1\.2#", $page);
108 108
             } else {
@@ -127,13 +127,13 @@  discard block
 block discarded – undo
127 127
      * @group xapian
128 128
      */
129 129
     public function testGlossaryAndSearchHighlights() {
130
-            $page = $this->fetch_page( array( 'type' => 'lords', 's' => 'constituency', 'id' => '2014-02-02b.1.3' ) );
130
+            $page = $this->fetch_page(array('type' => 'lords', 's' => 'constituency', 'id' => '2014-02-02b.1.3'));
131 131
             $this->assertStringContainsString("constituency", $page);
132 132
             $this->assertStringContainsString("<span class=\"hi\"><a href=\"/glossary/?gl=1\" title=\"In a general election, each Constituency chooses an MP to represent them....\" class=\"glossary\">constituency</a></span>", $page);
133 133
     }
134 134
 
135 135
     public function testGidRedirect() {
136
-        $page = $this->fetch_page( array( 'type' => 'wrans', 'id' => '2014-01-01a.187335.h' ) );
136
+        $page = $this->fetch_page(array('type' => 'wrans', 'id' => '2014-01-01a.187335.h'));
137 137
         $this->assertMatchesRegularExpression("#Location: .*?/wrans/\?id=2014-01-01b\.1\.2#", $page);
138 138
     }
139 139
 }
Please login to merge, or discard this patch.
tests/PageTest.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
      */
12 12
     public function getDataSet()
13 13
     {
14
-        return $this->createMySQLXMLDataSet(dirname(__FILE__).'/_fixtures/member.xml');
14
+        return $this->createMySQLXMLDataSet(dirname(__FILE__) . '/_fixtures/member.xml');
15 15
     }
16 16
 
17 17
     private function fetch_page($vars)
@@ -21,14 +21,14 @@  discard block
 block discarded – undo
21 21
 
22 22
     public function testQueenie()
23 23
     {
24
-        $page = $this->fetch_page( array( 'representative_type' => 'royal', 'n' => 'elizabeth_the_second' ) );
24
+        $page = $this->fetch_page(array('representative_type' => 'royal', 'n' => 'elizabeth_the_second'));
25 25
         $this->assertStringContainsString('Elizabeth the Second', $page);
26 26
         $this->assertStringContainsString('Coronated on 2 June 1953', $page);
27 27
     }
28 28
 
29 29
     public function testSittingMP()
30 30
     {
31
-        $page = $this->fetch_page( array( 'pid' => 2, 'url' => '/mp/2/test_current-mp/test_westminster_constituency' ) );
31
+        $page = $this->fetch_page(array('pid' => 2, 'url' => '/mp/2/test_current-mp/test_westminster_constituency'));
32 32
         $this->assertStringContainsString('Test Current-MP', $page);
33 33
         $this->assertMatchesRegularExpression('#<span class="person-header__about__position__constituency">\s*Test Westminster Constituency\s*</span>#', $page);
34 34
         $this->assertMatchesRegularExpression('#<span class="person-header__about__position__role">\s*Labour\s*MP\s*</span>#', $page);
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 
37 37
     public function testSittingMLA()
38 38
     {
39
-        $page = $this->fetch_page( array( 'pid' => 4, 'representative_type' => 'mla', 'url' => '/mp/4/test_current-mla' ) );
39
+        $page = $this->fetch_page(array('pid' => 4, 'representative_type' => 'mla', 'url' => '/mp/4/test_current-mla'));
40 40
         $this->assertStringContainsString('Test Current-MLA', $page);
41 41
         $this->assertMatchesRegularExpression('#<span class="person-header__about__position__constituency">\s*Test Northern Ireland Constituency\s*</span>#', $page);
42 42
         $this->assertMatchesRegularExpression('#<span class="person-header__about__position__role">\s*Sinn Féin\s*MLA\s*</span>#', $page);
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
      */
48 48
     public function testSittingSinnFeinMP()
49 49
     {
50
-        $page = $this->fetch_page( array( 'pid' => 15, 'url' => '/mp/15/test_current-sf-mp/test_westminster_constituency' ) );
50
+        $page = $this->fetch_page(array('pid' => 15, 'url' => '/mp/15/test_current-sf-mp/test_westminster_constituency'));
51 51
         $this->assertStringContainsString('Sinn F&eacute;in MPs do not take their seats in Parliament.', $page);
52 52
     }
53 53
 
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
      */
57 57
     public function testSittingNonSinnFeinMP()
58 58
     {
59
-        $page = $this->fetch_page( array( 'pid' => 2, 'url' => '/mp/2/test_current-mp/test_westminster_constituency' ) );
59
+        $page = $this->fetch_page(array('pid' => 2, 'url' => '/mp/2/test_current-mp/test_westminster_constituency'));
60 60
         $this->assertStringNotContainsString('Sinn F&eacute;in MPs do not take their seats in Parliament.', $page);
61 61
     }
62 62
 
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
      */
66 66
     public function testSpeaker()
67 67
     {
68
-        $page = $this->fetch_page( array( 'pid' => 13, 'url' => '/mp/13/test_speaker/buckingham' ) );
68
+        $page = $this->fetch_page(array('pid' => 13, 'url' => '/mp/13/test_speaker/buckingham'));
69 69
         $this->assertMatchesRegularExpression('#<span class="person-header__about__position__role">\s*Speaker\s*MP\s*</span>#', $page);
70 70
     }
71 71
 
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
         # makes sure it is empty in case there's something hanging
76 76
         # about in memcached
77 77
         $banner->set_text('', "banner");
78
-        $page = $this->fetch_page( array( 'url' => '/' ) );
78
+        $page = $this->fetch_page(array('url' => '/'));
79 79
         $this->assertStringNotContainsString('<div class="banner">', $page);
80 80
         $this->assertStringNotContainsString('This is a banner', $page);
81 81
 
@@ -95,20 +95,20 @@  discard block
 block discarded – undo
95 95
         ';
96 96
         
97 97
         $banner->set_text($banner_config, "banner");
98
-        $page = $this->fetch_page( array( 'url' => '/' ) );
98
+        $page = $this->fetch_page(array('url' => '/'));
99 99
         $this->assertStringContainsString('This is a banner', $page);
100 100
 
101 101
         $banner->set_text('', "banner");
102
-        $page = $this->fetch_page( array( 'url' => '/' ) );
102
+        $page = $this->fetch_page(array('url' => '/'));
103 103
         $this->assertStringNotContainsString('<div class="banner">', $page);
104 104
         $this->assertStringNotContainsString('This is a banner', $page);
105 105
     }
106 106
 
107 107
     public function testNewMPMessage() {
108
-        $page = $this->fetch_page( array( 'pid' => 17, 'url' => '/mp/17/recent_mp/test_westminster_constituency' ) );
108
+        $page = $this->fetch_page(array('pid' => 17, 'url' => '/mp/17/recent_mp/test_westminster_constituency'));
109 109
         $this->assertStringNotContainsString('is a recently elected MP', $page);
110 110
         self::$db->query('UPDATE member SET entered_house = NOW() WHERE person_id = 17');
111
-        $page = $this->fetch_page( array( 'pid' => 17, 'url' => '/mp/17/recent_mp/test_westminster_constituency' ) );
111
+        $page = $this->fetch_page(array('pid' => 17, 'url' => '/mp/17/recent_mp/test_westminster_constituency'));
112 112
         $this->assertStringContainsString('is a recently elected MP', $page);
113 113
     }
114 114
 
Please login to merge, or discard this patch.