Completed
Branch master (84c25f)
by Nick
32:17
created
tests/DivisionsTest.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -17,17 +17,17 @@  discard block
 block discarded – undo
17 17
     }
18 18
 
19 19
     private function fetch_division_page() {
20
-        return $this->fetch_page( array( 'pagetype' => 'divisions', 'pid' => 2, 'policy' => 363, 'url' => '/mp/2/test_current-mp/test_westminster_constituency/divisions' ) );
20
+        return $this->fetch_page(array('pagetype' => 'divisions', 'pid' => 2, 'policy' => 363, 'url' => '/mp/2/test_current-mp/test_westminster_constituency/divisions'));
21 21
     }
22 22
 
23 23
     private function fetch_mp_recent_page()
24 24
     {
25
-        $vars = array( 'pagetype' => 'recent', 'pid' => 2, 'url' => '/mp/2/test_current-mp/test_westminster_constituency/recent' );
25
+        $vars = array('pagetype' => 'recent', 'pid' => 2, 'url' => '/mp/2/test_current-mp/test_westminster_constituency/recent');
26 26
         return $this->base_fetch_page($vars, 'mp', 'index.php', '/mp/recent.php');
27 27
     }
28 28
 
29 29
     private function fetch_recent_page() {
30
-        return $this->base_fetch_page( array('url' => '/divisions' ), 'divisions', 'index.php', '/divisions/index.php' );
30
+        return $this->base_fetch_page(array('url' => '/divisions'), 'divisions', 'index.php', '/divisions/index.php');
31 31
     }
32 32
 
33 33
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
     }
114 114
 
115 115
     public function testNotEnoughInfoStatement() {
116
-        return $this->fetch_page( array( 'pagetype' => 'divisions', 'pid' => 2, 'policy' => 810, 'url' => '/mp/2/test_current-mp/test_westminster_constituency/divisions' ) );
116
+        return $this->fetch_page(array('pagetype' => 'divisions', 'pid' => 2, 'policy' => 810, 'url' => '/mp/2/test_current-mp/test_westminster_constituency/divisions'));
117 117
         $this->assertContains('we don’t have enough information to calculate Test Current-MP’s position', $page);
118 118
     }
119 119
 
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
     }
125 125
 
126 126
     public function testSingleDivision() {
127
-        $page = $this->base_fetch_page( array('url' => '/divisions/division.php', 'vote' => 'pw-3012-01-01-1-commons' ), 'divisions', 'division.php', '/divisions/division.php' );
127
+        $page = $this->base_fetch_page(array('url' => '/divisions/division.php', 'vote' => 'pw-3012-01-01-1-commons'), 'divisions', 'division.php', '/divisions/division.php');
128 128
         $this->assertContains('A majority of MPs  <b>voted in favour</b> of a thing', $page);
129 129
         $this->assertContains('198 for', $page);
130 130
         $this->assertContains('98 against', $page);
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/FetchPageTestCase.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
     protected function base_fetch_page($vars, $dir, $page = 'index.php', $req_uri = '')
10 10
     {
11 11
         foreach ($vars as $k => $v) {
12
-            $vars[$k] =  $k . '=' . urlencode($v);
12
+            $vars[$k] = $k . '=' . urlencode($v);
13 13
         }
14 14
 
15 15
         if (!$req_uri) {
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.
tests/AlertsTest.php 1 patch
Spacing   +6 added lines, -6 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/alerts.xml');
14
+        return $this->createMySQLXMLDataSet(dirname(__FILE__) . '/_fixtures/alerts.xml');
15 15
     }
16 16
 
17 17
     /**
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
     {
32 32
         $ALERT = new ALERT();
33 33
 
34
-        $response = $ALERT->fetch(0,0);
34
+        $response = $ALERT->fetch(0, 0);
35 35
 
36 36
         // Make sure we only get one response
37 37
         $this->assertEquals(1, count($response['data']));
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
     {
49 49
         $ALERT = new ALERT();
50 50
 
51
-        $response = $ALERT->fetch(1,0);
51
+        $response = $ALERT->fetch(1, 0);
52 52
 
53 53
         // Make sure we only get two responses
54 54
         $this->assertEquals(2, count($response['data']));
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     {
66 66
         $ALERT = new ALERT();
67 67
 
68
-        $response = $ALERT->fetch(0,1);
68
+        $response = $ALERT->fetch(0, 1);
69 69
 
70 70
         // Make sure we only get one response
71 71
         $this->assertEquals(1, count($response['data']));
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
     {
83 83
         $ALERT = new ALERT();
84 84
 
85
-        $response = $ALERT->fetch(1,1);
85
+        $response = $ALERT->fetch(1, 1);
86 86
 
87 87
         // Make sure we only get one response
88 88
         $this->assertEquals(1, count($response['data']));
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
     {
100 100
         $ALERT = new ALERT();
101 101
 
102
-        $response = $ALERT->fetch_between(1,1, '2014-02-01', '2014-02-02');
102
+        $response = $ALERT->fetch_between(1, 1, '2014-02-01', '2014-02-02');
103 103
 
104 104
         // Make sure we only get one response
105 105
         $this->assertEquals(1, count($response['alerts']));
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.
scripts/video-availability.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,8 @@
 block discarded – undo
22 22
     if ($start_date == $end_date) {
23 23
         $qq = $db->query("update hansard set video_status = video_status | 1
24 24
 	    where hdate='$start_date' and htime>='$start_time' and htime<'$end_time' and major=1");
25
-    } else {
25
+    }
26
+    else {
26 27
         $qq = $db->query("update hansard set video_status = video_status | 1
27 28
 	    where ((hdate='$start_date' and htime>='$start_time')
28 29
 	       or (hdate='$end_date' and htime<'$end_time')) and major=1");
Please login to merge, or discard this patch.