Completed
Pull Request — master (#1325)
by Nick
06:30 queued 01:28
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/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/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.