Passed
Pull Request — master (#1474)
by Nick
34:57
created
classes/SectionView/NiView.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 
33 33
     protected function getSearchSections() {
34 34
         return array(
35
-            array( 'section' => 'ni' )
35
+            array('section' => 'ni')
36 36
         );
37 37
     }
38 38
 
@@ -52,23 +52,23 @@  discard block
 block discarded – undo
52 52
 
53 53
         $debates = $DEBATELIST->display('recent_debates', array('days' => 30, 'num' => 6), 'none');
54 54
         $MOREURL = new \MySociety\TheyWorkForYou\Url('nidebatesfront');
55
-        $MOREURL->insert( array( 'more' => 1 ) );
55
+        $MOREURL->insert(array('more' => 1));
56 56
 
57 57
         // this makes sure that we don't repeat this debate in the list below
58 58
         $random_debate = NULL;
59
-        if ( isset($debates['data']) && count($debates['data']) ) {
59
+        if (isset($debates['data']) && count($debates['data'])) {
60 60
             $random_debate = $debates['data'][0];
61 61
         }
62 62
 
63 63
         $recent = array();
64
-        if ( isset($debates['data']) && count($debates['data']) ) {
64
+        if (isset($debates['data']) && count($debates['data'])) {
65 65
             // at the start of a session there may be less than 6
66 66
             // debates
67 67
             $max = 6;
68
-            if ( count($debates['data']) < 6 ) {
68
+            if (count($debates['data']) < 6) {
69 69
                 $max = count($debates['data']);
70 70
             }
71
-            for ( $i = 1; $i < $max; $i++ ) {
71
+            for ($i = 1; $i < $max; $i++) {
72 72
                 $debate = $debates['data'][$i];
73 73
                 $debate['desc'] = "Northern Ireland Assembly debates";
74 74
                 $debate['more_url'] = $MOREURL->generate();
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
         }
78 78
 
79 79
         $featured = array();
80
-        if ( $random_debate ) {
80
+        if ($random_debate) {
81 81
             $featured = $random_debate;
82 82
             $featured['more_url'] = $MOREURL->generate();
83 83
             $featured['desc'] = 'Northern Ireland Assembly debate';
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
         }
87 87
 
88 88
         $data['featured'] = $featured;
89
-        $data['debates'] = array( 'recent' => $recent);
89
+        $data['debates'] = array('recent' => $recent);
90 90
 
91 91
         $data['regional'] = $this->getMLAList();
92 92
         $data['template'] = 'ni/index';
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 
43 43
         $data = array();
44 44
 
45
-        $data['popular_searches'] = NULL;
45
+        $data['popular_searches'] = null;
46 46
 
47 47
 
48 48
         $data['urls'] = $this->getURLs($data);
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
         $MOREURL->insert( array( 'more' => 1 ) );
55 55
 
56 56
         // this makes sure that we don't repeat this debate in the list below
57
-        $random_debate = NULL;
57
+        $random_debate = null;
58 58
         if ( isset($debates['data']) && count($debates['data']) ) {
59 59
             $random_debate = $debates['data'][0];
60 60
         }
Please login to merge, or discard this patch.
classes/GlossaryEditQueue.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -68,8 +68,7 @@
 block discarded – undo
68 68
                             WHERE edit_id=" . $approval_id . ";");
69 69
             if (!$q->success()) {
70 70
                 break;
71
-            }
72
-            else {
71
+            } else {
73 72
                 // Scrub that one from the list of pending items
74 73
                 unset ($this->pending[$approval_id]);
75 74
             }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@
 block discarded – undo
61 61
             // the new epobject id and approval details.
62 62
             $q = $this->db->query("UPDATE editqueue
63 63
                             SET
64
-                            glossary_id='" .  $this->current_epobject_id. "',
64
+                            glossary_id='" .  $this->current_epobject_id . "',
65 65
                             editor_id='" . addslashes($THEUSER->user_id()) . "',
66 66
                             approved='1',
67 67
                             decided='" . $timestamp . "'
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
@@ -26,9 +26,9 @@  discard block
 block discarded – undo
26 26
 
27 27
     public function set($key, $value, $timeout = 3600) {
28 28
         if (class_exists('\Memcached')) {
29
-            self::$memcache->set(OPTION_TWFY_DB_NAME.':'.$key, $value, $timeout);
29
+            self::$memcache->set(OPTION_TWFY_DB_NAME . ':' . $key, $value, $timeout);
30 30
         } else {
31
-            self::$memcache->set(OPTION_TWFY_DB_NAME.':'.$key, $value, MEMCACHE_COMPRESSED, $timeout);
31
+            self::$memcache->set(OPTION_TWFY_DB_NAME . ':' . $key, $value, MEMCACHE_COMPRESSED, $timeout);
32 32
         }
33 33
     }
34 34
 
@@ -36,9 +36,9 @@  discard block
 block discarded – undo
36 36
         // see http://php.net/manual/en/memcache.get.php#112056 for explanation of this
37 37
         $was_found = false;
38 38
         if (class_exists('\Memcached')) {
39
-            $value = self::$memcache->get(OPTION_TWFY_DB_NAME.':'.$key, null, $was_found);
39
+            $value = self::$memcache->get(OPTION_TWFY_DB_NAME . ':' . $key, null, $was_found);
40 40
         } else {
41
-            $value = self::$memcache->get(OPTION_TWFY_DB_NAME.':'.$key, $was_found);
41
+            $value = self::$memcache->get(OPTION_TWFY_DB_NAME . ':' . $key, $was_found);
42 42
         }
43 43
         if ($was_found === false) {
44 44
             return false; // mmmmm
Please login to merge, or discard this patch.
classes/SectionView/DebatesView.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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]");
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -66,7 +66,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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 = '';
Please login to merge, or discard this patch.
classes/FacebookLogin.php 3 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -36,10 +36,10 @@  discard block
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -13,11 +13,11 @@  discard block
 block discarded – undo
13 13
 
14 14
     public function getFacebookObject() {
15 15
         if (!isset($this->fb)) {
16
-          $this->fb = new \Facebook\Facebook([
16
+            $this->fb = new \Facebook\Facebook([
17 17
             'app_id' => FACEBOOK_APP_ID,
18 18
             'app_secret' => FACEBOOK_APP_SECRET,
19 19
             'default_graph_version' => 'v2.2',
20
-          ]);
20
+            ]);
21 21
         }
22 22
 
23 23
         return $this->fb;
@@ -30,46 +30,46 @@  discard block
 block discarded – undo
30 30
     }
31 31
 
32 32
     public function handleFacebookRedirect() {
33
-      $helper = $this->getFacebookObject()->getRedirectLoginHelper();
33
+        $helper = $this->getFacebookObject()->getRedirectLoginHelper();
34 34
 
35
-      $data = array('login_url' => $this->getLoginURL());
35
+        $data = array('login_url' => $this->getLoginURL());
36 36
 
37
-      try {
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
+        }
46 46
 
47
-      $token = $this->checkAccessToken($accessToken);
47
+        $token = $this->checkAccessToken($accessToken);
48 48
 
49
-      if ($token) {
50
-          return array('token' => $token);
51
-      } else {
52
-          $data['error'] = 'Problem getting Facebook token';
53
-          return $data;
54
-      }
49
+        if ($token) {
50
+            return array('token' => $token);
51
+        } else {
52
+            $data['error'] = 'Problem getting Facebook token';
53
+            return $data;
54
+        }
55 55
     }
56 56
 
57 57
 
58 58
     private function checkAccessToken($accessToken) {
59
-      if (!isset($accessToken)) {
60
-          return False;
61
-      }
59
+        if (!isset($accessToken)) {
60
+            return False;
61
+        }
62 62
 
63
-      if (! $accessToken->isLongLived()) {
63
+        if (! $accessToken->isLongLived()) {
64 64
         $oAuth2Client = $this->getFacebookObject()->getOAuth2Client();
65 65
         try {
66
-          $accessToken = $oAuth2Client->getLongLivedAccessToken($accessToken);
66
+            $accessToken = $oAuth2Client->getLongLivedAccessToken($accessToken);
67 67
         } catch (\Facebook\Exceptions\FacebookSDKException $e) {
68
-          return False;
68
+            return False;
69
+        }
69 70
         }
70
-      }
71 71
 
72
-      return $accessToken;
72
+        return $accessToken;
73 73
     }
74 74
 
75 75
     public function loginUser($accessToken) {
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
             'url' => $THEUSER->url(),
157 157
             'optin' => $THEUSER->optin(),
158 158
             'password' => '',
159
-         );
159
+            );
160 160
 
161 161
         $THEUSER->update_self_no_confirm($details);
162 162
     }
Please login to merge, or discard this patch.
Upper-Lower-Casing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
classes/Utility/Calendar.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@
 block discarded – undo
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 .= " &#8211; <a href='/mp/?p=$pid'>$name</a>";
97 97
             }
Please login to merge, or discard this patch.
tests/TopicsTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
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)
Please login to merge, or discard this patch.
tests/AlertsPageTest.php 1 patch
Spacing   +7 added lines, -7 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/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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
tests/PartyTest.php 1 patch
Spacing   +8 added lines, -8 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/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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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&rsquo;s votes', $page);
162 162
     }
Please login to merge, or discard this patch.