@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | $this->searchstring = $argparser->construct_search_string(); |
20 | 20 | $this->searchkeyword = $argparser->searchkeyword; |
21 | 21 | |
22 | - if ( !$this->searchstring ) { |
|
22 | + if (!$this->searchstring) { |
|
23 | 23 | $data = $this->get_form_params($data); |
24 | 24 | $data['searchstring'] = ''; |
25 | 25 | $data['template'] = 'search/results'; |
@@ -28,14 +28,14 @@ discard block |
||
28 | 28 | |
29 | 29 | $this->searchstring = filter_user_input($this->searchstring, 'strict'); |
30 | 30 | $warnings = $this->validate_search_string(); |
31 | - if ( $warnings ) { |
|
31 | + if ($warnings) { |
|
32 | 32 | $data['warnings'] = $warnings; |
33 | 33 | $data['template'] = 'search/results'; |
34 | 34 | $data['searchstring'] = $this->searchstring; |
35 | 35 | $data = $this->get_form_params($data); |
36 | 36 | return $data; |
37 | 37 | } else { |
38 | - if (get_http_var('o')=='p') { |
|
38 | + if (get_http_var('o') == 'p') { |
|
39 | 39 | $search = new Search\ByUsage(); |
40 | 40 | $data = $search->search($this->searchstring); |
41 | 41 | $data['template'] = 'search/by-person'; |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | $data['person_name'] = $MEMBER->full_name(); |
53 | 53 | } |
54 | 54 | |
55 | - if ( isset($data['info']['spelling_correction']) ) { |
|
55 | + if (isset($data['info']['spelling_correction'])) { |
|
56 | 56 | $data['info']['spelling_correction_display'] = $this->prettifySearchString($data['info']['spelling_correction']); |
57 | 57 | } |
58 | 58 | |
@@ -144,15 +144,15 @@ discard block |
||
144 | 144 | $data['search_keyword'] = $this->searchkeyword; |
145 | 145 | |
146 | 146 | $is_adv = false; |
147 | - foreach ( array('to', 'from', 'person', 'section', 'column', 'phrase', 'exclude' ) as $var ) { |
|
147 | + foreach (array('to', 'from', 'person', 'section', 'column', 'phrase', 'exclude') as $var) { |
|
148 | 148 | $key = "search_$var"; |
149 | - $data[$key] = get_http_var( $var ); |
|
150 | - if ( $data[$key] ) { |
|
149 | + $data[$key] = get_http_var($var); |
|
150 | + if ($data[$key]) { |
|
151 | 151 | $is_adv = true; |
152 | 152 | } |
153 | 153 | } |
154 | 154 | |
155 | - if ( isset($data['search_section']) ) { |
|
155 | + if (isset($data['search_section'])) { |
|
156 | 156 | $data['search_section_pretty'] = $this->prettify_search_section($data['search_section']); |
157 | 157 | } |
158 | 158 | |
@@ -162,16 +162,16 @@ discard block |
||
162 | 162 | |
163 | 163 | private function set_wtt_options($data) { |
164 | 164 | $data['wtt'] = ''; |
165 | - if ( $wtt = get_http_var('wtt') ) { |
|
165 | + if ($wtt = get_http_var('wtt')) { |
|
166 | 166 | $data['wtt'] = $wtt; |
167 | - if ( $wtt == 2 && $pid = get_http_var('pid') ) { |
|
167 | + if ($wtt == 2 && $pid = get_http_var('pid')) { |
|
168 | 168 | $data['pid'] = null; |
169 | 169 | try { |
170 | 170 | $lord = new Member(array('person_id' => $pid, 'house' => 2)); |
171 | - } catch ( MemberException $e ) { |
|
171 | + } catch (MemberException $e) { |
|
172 | 172 | return $data; |
173 | 173 | } |
174 | - if ( $lord->valid ) { |
|
174 | + if ($lord->valid) { |
|
175 | 175 | $data['pid'] = $pid; |
176 | 176 | $data['wtt_lord_name'] = $lord->full_name(); |
177 | 177 | } |
@@ -196,11 +196,11 @@ discard block |
||
196 | 196 | $url->insert(array('q' => $value)); |
197 | 197 | } |
198 | 198 | |
199 | - if ( $params ) { |
|
200 | - if ( get_http_var('house') ) { |
|
199 | + if ($params) { |
|
200 | + if (get_http_var('house')) { |
|
201 | 201 | $url->insert(array('house' => get_http_var('house'))); |
202 | 202 | } |
203 | - if ( get_http_var('wtt') ) { |
|
203 | + if (get_http_var('wtt')) { |
|
204 | 204 | $url->insert(array('wtt' => get_http_var('wtt'))); |
205 | 205 | } |
206 | 206 | } else { |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | global $DATA, $this_page; |
215 | 215 | |
216 | 216 | $pagetitle = ''; |
217 | - if ( isset($data['search_type']) && $data['search_type'] == 'person' ) { |
|
217 | + if (isset($data['search_type']) && $data['search_type'] == 'person') { |
|
218 | 218 | if (isset($data['wtt']) && $data['wtt'] > 0) { |
219 | 219 | $pagetitle = 'League table of Lords who say ' . $data['pagetitle']; |
220 | 220 | } else { |
@@ -82,45 +82,45 @@ |
||
82 | 82 | private function prettify_search_section($section) { |
83 | 83 | $name = ''; |
84 | 84 | switch ($section) { |
85 | - case 'wrans': |
|
86 | - $name = 'Written Answers'; |
|
87 | - break; |
|
88 | - case 'uk': |
|
89 | - $name = 'All UK'; |
|
90 | - break; |
|
91 | - case 'debates': |
|
92 | - $name = 'House of Commons debates'; |
|
93 | - break; |
|
94 | - case 'whall': |
|
95 | - $name = 'Westminster Hall debates'; |
|
96 | - break; |
|
97 | - case 'lords': |
|
98 | - $name = 'House of Lords debates'; |
|
99 | - break; |
|
100 | - case 'wms': |
|
101 | - $name = 'Written ministerial statements'; |
|
102 | - break; |
|
103 | - case 'standing': |
|
104 | - $name = 'Bill Committees'; |
|
105 | - break; |
|
106 | - case 'future': |
|
107 | - $name = 'Future Business'; |
|
108 | - break; |
|
109 | - case 'ni': |
|
110 | - $name = 'Northern Ireland Assembly Debates'; |
|
111 | - break; |
|
112 | - case 'scotland': |
|
113 | - $name = 'All Scotland'; |
|
114 | - break; |
|
115 | - case 'sp': |
|
116 | - $name = 'Scottish Parliament Debates'; |
|
117 | - break; |
|
118 | - case 'spwrans': |
|
119 | - $name = 'Scottish Parliament Written answers'; |
|
120 | - break; |
|
121 | - case 'lmqs': |
|
122 | - $name = 'Questions to the Mayor of London'; |
|
123 | - break; |
|
85 | + case 'wrans': |
|
86 | + $name = 'Written Answers'; |
|
87 | + break; |
|
88 | + case 'uk': |
|
89 | + $name = 'All UK'; |
|
90 | + break; |
|
91 | + case 'debates': |
|
92 | + $name = 'House of Commons debates'; |
|
93 | + break; |
|
94 | + case 'whall': |
|
95 | + $name = 'Westminster Hall debates'; |
|
96 | + break; |
|
97 | + case 'lords': |
|
98 | + $name = 'House of Lords debates'; |
|
99 | + break; |
|
100 | + case 'wms': |
|
101 | + $name = 'Written ministerial statements'; |
|
102 | + break; |
|
103 | + case 'standing': |
|
104 | + $name = 'Bill Committees'; |
|
105 | + break; |
|
106 | + case 'future': |
|
107 | + $name = 'Future Business'; |
|
108 | + break; |
|
109 | + case 'ni': |
|
110 | + $name = 'Northern Ireland Assembly Debates'; |
|
111 | + break; |
|
112 | + case 'scotland': |
|
113 | + $name = 'All Scotland'; |
|
114 | + break; |
|
115 | + case 'sp': |
|
116 | + $name = 'Scottish Parliament Debates'; |
|
117 | + break; |
|
118 | + case 'spwrans': |
|
119 | + $name = 'Scottish Parliament Written answers'; |
|
120 | + break; |
|
121 | + case 'lmqs': |
|
122 | + $name = 'Questions to the Mayor of London'; |
|
123 | + break; |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | return $name; |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | $DEBATELIST = new \DEBATELIST; |
17 | 17 | $debates = array(); |
18 | 18 | $debates['data'] = $DEBATELIST->display('biggest_debates', array('days'=>7, 'num'=>10), 'none'); |
19 | - $args = array( 'months' => 1 ); |
|
19 | + $args = array('months' => 1); |
|
20 | 20 | $debates['calendar'] = $DEBATELIST->display('calendar', $args, 'none'); |
21 | 21 | $debates['rssurl'] = $DATA->page_metadata($this_page, 'rss'); |
22 | 22 | |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | |
27 | 27 | $WHALLLIST = new \WHALLLIST; |
28 | 28 | $whall['data'] = $WHALLLIST->display('biggest_debates', array('days'=>7, 'num'=>10), 'none'); |
29 | - $args = array( 'months' => 1 ); |
|
29 | + $args = array('months' => 1); |
|
30 | 30 | $whall['calendar'] = $WHALLLIST->display('calendar', $args, 'none'); |
31 | 31 | $whall['rssurl'] = $DATA->page_metadata($this_page, 'rss'); |
32 | 32 | |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | |
37 | 37 | $LORDSDEBATELIST = new \LORDSDEBATELIST; |
38 | 38 | $lords['data'] = $LORDSDEBATELIST->display('biggest_debates', array('days'=>7, 'num'=>10), 'none'); |
39 | - $args = array( 'months' => 1 ); |
|
39 | + $args = array('months' => 1); |
|
40 | 40 | $lords['calendar'] = $LORDSDEBATELIST->display('calendar', $args, 'none'); |
41 | 41 | |
42 | 42 | $lords['rssurl'] = $DATA->page_metadata($this_page, 'rss'); |
@@ -55,9 +55,9 @@ discard block |
||
55 | 55 | |
56 | 56 | protected function getSearchSections() { |
57 | 57 | return array( |
58 | - array( 'section' => 'debates', 'title' => 'House of Commons' ), |
|
59 | - array( 'section' => 'lords', 'title' => 'House of Lords' ), |
|
60 | - array( 'section' => 'whall', 'title' => 'Westminster Hall' ) |
|
58 | + array('section' => 'debates', 'title' => 'House of Commons'), |
|
59 | + array('section' => 'lords', 'title' => 'House of Lords'), |
|
60 | + array('section' => 'whall', 'title' => 'Westminster Hall') |
|
61 | 61 | ); |
62 | 62 | } |
63 | 63 | |
@@ -69,11 +69,11 @@ discard block |
||
69 | 69 | if (!$this->first_gid) $this->first_gid = $row['gid']; |
70 | 70 | |
71 | 71 | $video_content = ''; |
72 | - if (!$this->first_video_displayed && $row['video_status']&4 && !($row['video_status']&8)) { |
|
72 | + if (!$this->first_video_displayed && $row['video_status'] & 4 && !($row['video_status'] & 8)) { |
|
73 | 73 | $video_content = $this->video_sidebar($row, $heading_hpos, $speeches); |
74 | 74 | $this->first_video_displayed = true; |
75 | 75 | } |
76 | - if (!$video_content && !$this->first_speech_displayed && $row['video_status']&1 && !($row['video_status']&12)) { |
|
76 | + if (!$video_content && !$this->first_speech_displayed && $row['video_status'] & 1 && !($row['video_status'] & 12)) { |
|
77 | 77 | $video_content = $this->video_advert($row); |
78 | 78 | $this->first_speech_displayed = true; |
79 | 79 | } |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | if ($count > 1) { |
105 | 105 | $out .= '<div class="debate__video" id="video_wrap"><div>'; |
106 | 106 | if ($row['gid'] != $this->first_gid) { |
107 | - $out .= '<p class="video-instructions">This video starts around ' . ($row['hpos']-$heading_hpos) . ' speeches in (<a href="#g' . gid_to_anchor($row['gid']) . '">move there in text</a>)</p>'; |
|
107 | + $out .= '<p class="video-instructions">This video starts around ' . ($row['hpos'] - $heading_hpos) . ' speeches in (<a href="#g' . gid_to_anchor($row['gid']) . '">move there in text</a>)</p>'; |
|
108 | 108 | } |
109 | 109 | } |
110 | 110 | $out .= \MySociety\TheyWorkForYou\Utility\Video::object($video['id'], $start, "$gid_type/$row[gid]"); |
@@ -66,7 +66,9 @@ discard block |
||
66 | 66 | private $first_gid = ''; |
67 | 67 | |
68 | 68 | protected function get_video_html($row, $heading_hpos, $speeches) { |
69 | - if (!$this->first_gid) $this->first_gid = $row['gid']; |
|
69 | + if (!$this->first_gid) { |
|
70 | + $this->first_gid = $row['gid']; |
|
71 | + } |
|
70 | 72 | |
71 | 73 | $video_content = ''; |
72 | 74 | if (!$this->first_video_displayed && $row['video_status']&4 && !($row['video_status']&8)) { |
@@ -97,7 +99,9 @@ discard block |
||
97 | 99 | $adate = $vq['adate']; |
98 | 100 | $time = $vq['atime']; |
99 | 101 | $videodb = \MySociety\TheyWorkForYou\Utility\Video::dbConnect(); |
100 | - if (!$videodb) return ''; |
|
102 | + if (!$videodb) { |
|
103 | + return ''; |
|
104 | + } |
|
101 | 105 | $video = \MySociety\TheyWorkForYou\Utility\Video::fromTimestamp($videodb, $adate, $time); |
102 | 106 | $start = $video['offset']; |
103 | 107 | $out = ''; |
@@ -36,10 +36,10 @@ discard block |
||
36 | 36 | |
37 | 37 | try { |
38 | 38 | $accessToken = $helper->getAccessToken(); |
39 | - } catch(\Facebook\Exceptions\FacebookResponseException $e) { |
|
39 | + } catch (\Facebook\Exceptions\FacebookResponseException $e) { |
|
40 | 40 | $data['error'] = 'Graph returned an error: ' . $e->getMessage(); |
41 | 41 | return $data; |
42 | - } catch(\Facebook\Exceptions\FacebookSDKException $e) { |
|
42 | + } catch (\Facebook\Exceptions\FacebookSDKException $e) { |
|
43 | 43 | $data['error'] = 'Facebook SDK returned an error: ' . $e->getMessage(); |
44 | 44 | return $data; |
45 | 45 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | return False; |
61 | 61 | } |
62 | 62 | |
63 | - if (! $accessToken->isLongLived()) { |
|
63 | + if (!$accessToken->isLongLived()) { |
|
64 | 64 | $oAuth2Client = $this->getFacebookObject()->getOAuth2Client(); |
65 | 65 | try { |
66 | 66 | $accessToken = $oAuth2Client->getLongLivedAccessToken($accessToken); |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | |
58 | 58 | private function checkAccessToken($accessToken) { |
59 | 59 | if (!isset($accessToken)) { |
60 | - return False; |
|
60 | + return false; |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | if (! $accessToken->isLongLived()) { |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | try { |
66 | 66 | $accessToken = $oAuth2Client->getLongLivedAccessToken($accessToken); |
67 | 67 | } catch (\Facebook\Exceptions\FacebookSDKException $e) { |
68 | - return False; |
|
68 | + return false; |
|
69 | 69 | } |
70 | 70 | } |
71 | 71 | |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | $expires = intval($accessToken->getExpiresAt()->format('U')); |
87 | 87 | twfy_debug("THEUSER", "Facebook access token expires at " . $expires); |
88 | 88 | |
89 | - $success = False; |
|
89 | + $success = false; |
|
90 | 90 | if ($user_id) { |
91 | 91 | twfy_debug("THEUSER", "Faceook user exists in the database: " . $user_id); |
92 | 92 | $success = $THEUSER->init($user_id); |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | return $logged_in; |
113 | 113 | } |
114 | 114 | |
115 | - return False; |
|
115 | + return false; |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | public function createUser($accessToken, $user) { |
@@ -128,8 +128,8 @@ discard block |
||
128 | 128 | 'url' => '', |
129 | 129 | 'status' => '', |
130 | 130 | 'password' => '', |
131 | - 'optin' => False, |
|
132 | - 'mp_alert' => False, |
|
131 | + 'optin' => false, |
|
132 | + 'mp_alert' => false, |
|
133 | 133 | 'facebook_id' => $user['id'] |
134 | 134 | ); |
135 | 135 | $added = $THEUSER->add($details, false); |
@@ -16,11 +16,11 @@ discard block |
||
16 | 16 | return; |
17 | 17 | } |
18 | 18 | if (!isset($this->fb)) { |
19 | - $this->fb = new \Facebook\Facebook([ |
|
19 | + $this->fb = new \Facebook\Facebook([ |
|
20 | 20 | 'app_id' => FACEBOOK_APP_ID, |
21 | 21 | 'app_secret' => FACEBOOK_APP_SECRET, |
22 | 22 | 'default_graph_version' => 'v2.2', |
23 | - ]); |
|
23 | + ]); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | return $this->fb; |
@@ -37,46 +37,46 @@ discard block |
||
37 | 37 | } |
38 | 38 | |
39 | 39 | public function handleFacebookRedirect() { |
40 | - $helper = $this->getFacebookObject()->getRedirectLoginHelper(); |
|
40 | + $helper = $this->getFacebookObject()->getRedirectLoginHelper(); |
|
41 | 41 | |
42 | - $data = array('login_url' => $this->getLoginURL()); |
|
42 | + $data = array('login_url' => $this->getLoginURL()); |
|
43 | 43 | |
44 | - try { |
|
44 | + try { |
|
45 | 45 | $accessToken = $helper->getAccessToken(); |
46 | - } catch(\Facebook\Exceptions\FacebookResponseException $e) { |
|
46 | + } catch(\Facebook\Exceptions\FacebookResponseException $e) { |
|
47 | 47 | $data['error'] = 'Graph returned an error: ' . $e->getMessage(); |
48 | 48 | return $data; |
49 | - } catch(\Facebook\Exceptions\FacebookSDKException $e) { |
|
49 | + } catch(\Facebook\Exceptions\FacebookSDKException $e) { |
|
50 | 50 | $data['error'] = 'Facebook SDK returned an error: ' . $e->getMessage(); |
51 | 51 | return $data; |
52 | - } |
|
52 | + } |
|
53 | 53 | |
54 | - $token = $this->checkAccessToken($accessToken); |
|
54 | + $token = $this->checkAccessToken($accessToken); |
|
55 | 55 | |
56 | - if ($token) { |
|
57 | - return array('token' => $token); |
|
58 | - } else { |
|
59 | - $data['error'] = 'Problem getting Facebook token'; |
|
60 | - return $data; |
|
61 | - } |
|
56 | + if ($token) { |
|
57 | + return array('token' => $token); |
|
58 | + } else { |
|
59 | + $data['error'] = 'Problem getting Facebook token'; |
|
60 | + return $data; |
|
61 | + } |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | |
65 | 65 | private function checkAccessToken($accessToken) { |
66 | - if (!isset($accessToken)) { |
|
67 | - return False; |
|
68 | - } |
|
66 | + if (!isset($accessToken)) { |
|
67 | + return False; |
|
68 | + } |
|
69 | 69 | |
70 | - if (! $accessToken->isLongLived()) { |
|
70 | + if (! $accessToken->isLongLived()) { |
|
71 | 71 | $oAuth2Client = $this->getFacebookObject()->getOAuth2Client(); |
72 | 72 | try { |
73 | - $accessToken = $oAuth2Client->getLongLivedAccessToken($accessToken); |
|
73 | + $accessToken = $oAuth2Client->getLongLivedAccessToken($accessToken); |
|
74 | 74 | } catch (\Facebook\Exceptions\FacebookSDKException $e) { |
75 | - return False; |
|
75 | + return False; |
|
76 | + } |
|
76 | 77 | } |
77 | - } |
|
78 | 78 | |
79 | - return $accessToken; |
|
79 | + return $accessToken; |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | public function loginUser($accessToken) { |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | 'url' => $THEUSER->url(), |
164 | 164 | 'optin' => $THEUSER->optin(), |
165 | 165 | 'password' => '', |
166 | - ); |
|
166 | + ); |
|
167 | 167 | |
168 | 168 | $THEUSER->update_self_no_confirm($details); |
169 | 169 | } |
@@ -91,7 +91,7 @@ |
||
91 | 91 | } else { |
92 | 92 | $title = $e['title']; |
93 | 93 | if ($pid = $e['person_id']) { |
94 | - $MEMBER = new \MEMBER(array( 'person_id' => $pid )); |
|
94 | + $MEMBER = new \MEMBER(array('person_id' => $pid)); |
|
95 | 95 | $name = $MEMBER->full_name(); |
96 | 96 | $title .= " – <a href='/mp/?p=$pid'>$name</a>"; |
97 | 97 | } |
@@ -11,7 +11,7 @@ |
||
11 | 11 | */ |
12 | 12 | public function getDataSet() |
13 | 13 | { |
14 | - return $this->createMySQLXMLDataSet(dirname(__FILE__).'/_fixtures/topics.xml'); |
|
14 | + return $this->createMySQLXMLDataSet(dirname(__FILE__) . '/_fixtures/topics.xml'); |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | private function fetch_topics_page($vars) |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | */ |
12 | 12 | public function getDataSet() |
13 | 13 | { |
14 | - return $this->createMySQLXMLDataSet(dirname(__FILE__).'/_fixtures/alertspage.xml'); |
|
14 | + return $this->createMySQLXMLDataSet(dirname(__FILE__) . '/_fixtures/alertspage.xml'); |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | private function fetch_page($vars) |
@@ -21,37 +21,37 @@ discard block |
||
21 | 21 | |
22 | 22 | public function testFetchPage() |
23 | 23 | { |
24 | - $page = $this->fetch_page( array() ); |
|
24 | + $page = $this->fetch_page(array()); |
|
25 | 25 | $this->assertContains('TheyWorkForYou Email Alerts', $page); |
26 | 26 | } |
27 | 27 | |
28 | 28 | public function testKeywordOnly() { |
29 | - $page = $this->fetch_page( array( 'alertsearch' => 'elephant') ); |
|
29 | + $page = $this->fetch_page(array('alertsearch' => 'elephant')); |
|
30 | 30 | $this->assertContains('Receive alerts when [elephant] is mentioned', $page); |
31 | 31 | } |
32 | 32 | |
33 | 33 | public function testPostCodeOnly() { |
34 | - $page = $this->fetch_page( array( 'alertsearch' => 'SE17 3HE') ); |
|
34 | + $page = $this->fetch_page(array('alertsearch' => 'SE17 3HE')); |
|
35 | 35 | $this->assertContains('when Mrs Test Current-MP', $page); |
36 | 36 | } |
37 | 37 | |
38 | 38 | public function testPostCodeWithKeyWord() |
39 | 39 | { |
40 | - $page = $this->fetch_page( array( 'alertsearch' => 'SE17 3HE elephant') ); |
|
40 | + $page = $this->fetch_page(array('alertsearch' => 'SE17 3HE elephant')); |
|
41 | 41 | $this->assertContains('You have used a postcode and something else', $page); |
42 | 42 | $this->assertContains('Mentions of [elephant] by Mrs Test Current-MP', $page); |
43 | 43 | $this->assertNotContains('by your MSP', $page); |
44 | 44 | } |
45 | 45 | |
46 | 46 | public function testScottishPostcodeWithKeyword() { |
47 | - $page = $this->fetch_page( array( 'alertsearch' => 'PH6 2DB elephant') ); |
|
47 | + $page = $this->fetch_page(array('alertsearch' => 'PH6 2DB elephant')); |
|
48 | 48 | $this->assertContains('You have used a postcode and something else', $page); |
49 | 49 | $this->assertContains('Mentions of [elephant] by your MP, Mr Test2 Current-MP', $page); |
50 | 50 | $this->assertContains('Mentions of [elephant] by your MSP, Mrs Test Current-MSP', $page); |
51 | 51 | } |
52 | 52 | |
53 | 53 | public function testPostcodeAndKeywordWithNoSittingMP() { |
54 | - $page = $this->fetch_page( array( 'alertsearch' => 'OX1 4LF elephant') ); |
|
54 | + $page = $this->fetch_page(array('alertsearch' => 'OX1 4LF elephant')); |
|
55 | 55 | $this->assertContains('You have used a postcode and something else', $page); |
56 | 56 | $this->assertNotContains('Did you mean to get alerts for when your MP', $page); |
57 | 57 | } |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | */ |
12 | 12 | public function getDataSet() |
13 | 13 | { |
14 | - return $this->createMySQLXMLDataSet(dirname(__FILE__).'/_fixtures/party.xml'); |
|
14 | + return $this->createMySQLXMLDataSet(dirname(__FILE__) . '/_fixtures/party.xml'); |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | private function fetch_page($vars) |
@@ -23,12 +23,12 @@ discard block |
||
23 | 23 | $party = new MySociety\TheyWorkForYou\Party('A Party'); |
24 | 24 | |
25 | 25 | $this->assertNotNull($party); |
26 | - $this->assertEquals( 'A Party', $party->name ); |
|
26 | + $this->assertEquals('A Party', $party->name); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | public function testCountMembers() { |
30 | 30 | $party = new MySociety\TheyWorkForYou\Party('A Party'); |
31 | - $this->assertEquals( $party->getCurrentMemberCount(HOUSE_TYPE_COMMONS), 2 ); |
|
31 | + $this->assertEquals($party->getCurrentMemberCount(HOUSE_TYPE_COMMONS), 2); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | public function testGetPolicyPositions() { |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | $this->assertEquals($expectedResults, $positions); |
116 | 116 | |
117 | 117 | $party = new MySociety\TheyWorkForYou\Party('Labour/Co-operative'); |
118 | - $party->cache_position( $positions['810'] ); |
|
118 | + $party->cache_position($positions['810']); |
|
119 | 119 | |
120 | 120 | $position = $party->policy_position(810); |
121 | 121 | $expected = ('voted a mixture of for and against'); |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | |
134 | 134 | public function testMPPartyPolicyTextWhenDiffers() |
135 | 135 | { |
136 | - $page = $this->fetch_page( array( 'pid' => 2, 'url' => '/mp/2/test_current-mp/test_westminster_constituency' ) ); |
|
136 | + $page = $this->fetch_page(array('pid' => 2, 'url' => '/mp/2/test_current-mp/test_westminster_constituency')); |
|
137 | 137 | $this->assertContains('Test Current-MP', $page); |
138 | 138 | $this->assertContains('is a A Party MP', $page); |
139 | 139 | $this->assertContains('sometimes <b>differs</b> from their party', $page); |
@@ -141,14 +141,14 @@ discard block |
||
141 | 141 | |
142 | 142 | public function testSingleMemberPartyPolicyText() |
143 | 143 | { |
144 | - $page = $this->fetch_page( array( 'pid' => 7, 'url' => '/mp/7/test_second-party-mp/test_westminster_constituency' ) ); |
|
144 | + $page = $this->fetch_page(array('pid' => 7, 'url' => '/mp/7/test_second-party-mp/test_westminster_constituency')); |
|
145 | 145 | $this->assertContains('Test Second-Party-MP', $page); |
146 | 146 | $this->assertNotContains('is a A Second Party MP', $page); |
147 | 147 | } |
148 | 148 | |
149 | 149 | public function testMPPartyPolicyWherePartyMissingPositions() |
150 | 150 | { |
151 | - $page = $this->fetch_page( array( 'pid' => 3, 'url' => '/mp/3/test_current-mp/test_westminster_constituency' ) ); |
|
151 | + $page = $this->fetch_page(array('pid' => 3, 'url' => '/mp/3/test_current-mp/test_westminster_constituency')); |
|
152 | 152 | $this->assertContains('Test Current-MP', $page); |
153 | 153 | $this->assertContains('is a A Party MP', $page); |
154 | 154 | $this->assertNotContains('while most A Party MPs voted', $page); |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | |
157 | 157 | public function testMPPartyPolicyTextWhenAgrees() |
158 | 158 | { |
159 | - $page = $this->fetch_page( array( 'pid' => 6, 'url' => '/mp/6/test_further-mp/test_westminster_constituency' ) ); |
|
159 | + $page = $this->fetch_page(array('pid' => 6, 'url' => '/mp/6/test_further-mp/test_westminster_constituency')); |
|
160 | 160 | $this->assertContains('Test Further-MP', $page); |
161 | 161 | $this->assertContains('This is a selection of Miss Test Further-MP’s votes', $page); |
162 | 162 | } |
@@ -11,7 +11,7 @@ |
||
11 | 11 | */ |
12 | 12 | public function getDataSet() |
13 | 13 | { |
14 | - return $this->createMySQLXMLDataSet(dirname(__FILE__).'/_fixtures/people.xml'); |
|
14 | + return $this->createMySQLXMLDataSet(dirname(__FILE__) . '/_fixtures/people.xml'); |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | /** |
@@ -11,7 +11,7 @@ |
||
11 | 11 | */ |
12 | 12 | public function getDataSet() |
13 | 13 | { |
14 | - return $this->createMySQLXMLDataSet(dirname(__FILE__).'/_fixtures/hansard.xml'); |
|
14 | + return $this->createMySQLXMLDataSet(dirname(__FILE__) . '/_fixtures/hansard.xml'); |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | /** |