Passed
Pull Request — master (#1428)
by Nick
06:09
created
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.
tests/PeopleTest.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/people.xml');
14
+        return $this->createMySQLXMLDataSet(dirname(__FILE__) . '/_fixtures/people.xml');
15 15
     }
16 16
 
17 17
     /**
Please login to merge, or discard this patch.
tests/HansardTest.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/hansard.xml');
14
+        return $this->createMySQLXMLDataSet(dirname(__FILE__) . '/_fixtures/hansard.xml');
15 15
     }
16 16
 
17 17
     /**
Please login to merge, or discard this patch.
tests/VotesTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
     }
18 18
 
19 19
     private function fetch_votes_page() {
20
-        return $this->fetch_page( array( 'pagetype' => 'votes', 'pid' => 2, 'url' => '/mp/2/test_current-mp/test_westminster_constituency/votes' ) );
20
+        return $this->fetch_page(array('pagetype' => 'votes', 'pid' => 2, 'url' => '/mp/2/test_current-mp/test_westminster_constituency/votes'));
21 21
     }
22 22
 
23 23
     public function testVoteSummary() {
Please login to merge, or discard this patch.
tests/AcceptBasicTest.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/acceptance.xml');
14
+        return $this->createMySQLXMLDataSet(dirname(__FILE__) . '/_fixtures/acceptance.xml');
15 15
     }
16 16
 
17 17
     private function fetch_page($path, $file = 'index.php', $vars = array())
Please login to merge, or discard this patch.
scripts/generate_party_positions.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -6,17 +6,17 @@
 block discarded – undo
6 6
 $policies = new MySociety\TheyWorkForYou\Policies;
7 7
 
8 8
 $party_count = 0;
9
-foreach ( $parties as $party ) {
9
+foreach ($parties as $party) {
10 10
     $party = new MySociety\TheyWorkForYou\Party($party);
11 11
 
12 12
     $positions = $party->calculateAllPolicyPositions($policies);
13 13
 
14
-    if ( count( $positions ) ) {
14
+    if (count($positions)) {
15 15
         $party_count++;
16 16
     }
17 17
 
18
-    foreach ( $positions as $position ) {
19
-        $party->cache_position( $position );
18
+    foreach ($positions as $position) {
19
+        $party->cache_position($position);
20 20
     }
21 21
 }
22 22
 
Please login to merge, or discard this patch.
www/docs/report/index.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
 $this_page = "commentreport";
6 6
 
7 7
 include_once '../../includes/easyparliament/init.php';
8
-include_once (INCLUDESPATH."easyparliament/commentreport.php");
8
+include_once (INCLUDESPATH . "easyparliament/commentreport.php");
9 9
 
10 10
 $PAGE->page_start();
11 11
 
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 
57 57
             $REPORT = new COMMENTREPORT;
58 58
 
59
-            $reportdata = array (
59
+            $reportdata = array(
60 60
                 'body'		=> get_http_var('body'),
61 61
                 'firstname'	=> get_http_var('firstname'),
62 62
                 'lastname'	=> get_http_var('lastname'),
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 
85 85
 
86 86
             } else {
87
-                $PAGE->error_message ("Sorry, we were unable to add the report to the database.");
87
+                $PAGE->error_message("Sorry, we were unable to add the report to the database.");
88 88
             }
89 89
         }
90 90
 
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 
100 100
 
101 101
 
102
-function display_form($COMMENT, $errors=array()) {
102
+function display_form($COMMENT, $errors = array()) {
103 103
     global $this_page, $THEUSER, $PAGE;
104 104
 
105 105
     ?>
Please login to merge, or discard this patch.