@@ -9,7 +9,7 @@ discard block |
||
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) { |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | } |
18 | 18 | |
19 | 19 | $vars = join('&', $vars); |
20 | - $command = 'parse_str($argv[1], $_GET); include_once("tests/Bootstrap.php"); chdir("www/docs/' . $dir . '"); include_once("' . $page . '");'; |
|
20 | + $command = 'parse_str($argv[1], $_GET); include_once("tests/Bootstrap.php"); chdir("www/docs/'.$dir.'"); include_once("'.$page.'");'; |
|
21 | 21 | $page = `REQUEST_URI=$req_uri REMOTE_ADDR=127.0.0.1 php -e -r '$command' -- '$vars'`; |
22 | 22 | |
23 | 23 | return $page; |
@@ -18,7 +18,7 @@ |
||
18 | 18 | /** |
19 | 19 | * Test converting a postcode to a constituency |
20 | 20 | */ |
21 | - public function testPostcodeToConstituency() |
|
21 | + public function testPostcodeToConstituency() |
|
22 | 22 | { |
23 | 23 | $this->assertEquals( |
24 | 24 | 'Cities of London and Westminster', |
@@ -21,37 +21,37 @@ |
||
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 | } |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | |
9 | 9 | public function getDataSet() |
10 | 10 | { |
11 | - return $this->createMySQLXMLDataSet(dirname(__FILE__) . '/_fixtures/divisions.xml'); |
|
11 | + return $this->createMySQLXMLDataSet(dirname(__FILE__).'/_fixtures/divisions.xml'); |
|
12 | 12 | } |
13 | 13 | |
14 | 14 | private function fetch_page($vars) |
@@ -17,17 +17,17 @@ discard block |
||
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 |
||
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 |
||
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); |
@@ -17,7 +17,7 @@ |
||
17 | 17 | /** |
18 | 18 | * Ensures the database is prepared and the comment class is included for every test. |
19 | 19 | */ |
20 | - public function setUp() { |
|
20 | + public function setUp() { |
|
21 | 21 | |
22 | 22 | parent::setUp(); |
23 | 23 |
@@ -56,7 +56,7 @@ |
||
56 | 56 | public function testHTMLCleaningOfAngleBrackets() { |
57 | 57 | $text = 'Is 2 < 3?'; |
58 | 58 | |
59 | - $this->assertEquals('Is 2 < 3?', filter_user_input( $text, 'comment' ) ); |
|
59 | + $this->assertEquals('Is 2 < 3?', filter_user_input($text, 'comment')); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | public function testHTMLCleaningWithNonASCIIChars() |
@@ -100,7 +100,7 @@ |
||
100 | 100 | ); |
101 | 101 | |
102 | 102 | $expectedTable = $this->createXmlDataSet(dirname(__FILE__).'/_fixtures/expectedTokens.xml') |
103 | - ->getTable("tokens"); |
|
103 | + ->getTable("tokens"); |
|
104 | 104 | $this->assertTablesEqual($expectedTable, $queryTable); |
105 | 105 | |
106 | 106 | $alertCount = $this->getConnection()->getRowCount('alerts', 'email = "[email protected]"'); |
@@ -44,8 +44,8 @@ discard block |
||
44 | 44 | $id = $u->user_id(); |
45 | 45 | $u->init($id); |
46 | 46 | |
47 | - $this->assertEquals( 'Test', $u->firstname() ); |
|
48 | - $this->assertEquals( 'EH1 99SP', $u->postcode() ); |
|
47 | + $this->assertEquals('Test', $u->firstname()); |
|
48 | + $this->assertEquals('EH1 99SP', $u->postcode()); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | public function testEditUser() { |
@@ -53,9 +53,9 @@ discard block |
||
53 | 53 | $u = new THEUSER(); |
54 | 54 | $u->loggedin = 1; |
55 | 55 | |
56 | - $this->assertEquals( 'Test', $u->firstname() ); |
|
56 | + $this->assertEquals('Test', $u->firstname()); |
|
57 | 57 | |
58 | - $d = $u->update_self( array( |
|
58 | + $d = $u->update_self(array( |
|
59 | 59 | 'firstname' => 'Experiment', |
60 | 60 | 'lastname' => 'User', |
61 | 61 | 'emailpublic' => '0', |
@@ -64,9 +64,9 @@ discard block |
||
64 | 64 | 'url' => '', |
65 | 65 | 'optin' => '', |
66 | 66 | 'user_id' => 1 |
67 | - ) ); |
|
67 | + )); |
|
68 | 68 | |
69 | - $this->assertEquals( 'Experiment', $u->firstname() ); |
|
69 | + $this->assertEquals('Experiment', $u->firstname()); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | public function testEditUserEmail() { |
@@ -74,9 +74,9 @@ discard block |
||
74 | 74 | $u = new THEUSER(); |
75 | 75 | $u->loggedin = 1; |
76 | 76 | |
77 | - $this->assertEquals( '[email protected]', $u->email() ); |
|
77 | + $this->assertEquals('[email protected]', $u->email()); |
|
78 | 78 | |
79 | - $d = $u->update_self( array( |
|
79 | + $d = $u->update_self(array( |
|
80 | 80 | 'firstname' => 'Experiment', |
81 | 81 | 'lastname' => 'User', |
82 | 82 | 'email' => '[email protected]', |
@@ -86,10 +86,10 @@ discard block |
||
86 | 86 | 'url' => '', |
87 | 87 | 'optin' => '', |
88 | 88 | 'user_id' => 1 |
89 | - ), false ); |
|
89 | + ), false); |
|
90 | 90 | |
91 | 91 | // email should not change as user needs to confirm |
92 | - $this->assertEquals( '[email protected]', $u->email() ); |
|
92 | + $this->assertEquals('[email protected]', $u->email()); |
|
93 | 93 | |
94 | 94 | $tokenCount = $this->getConnection()->getRowCount('tokens', 'data = "1::[email protected]"'); |
95 | 95 | $this->assertEquals(1, $tokenCount, 'correct number of email confirm tokens'); |
@@ -111,11 +111,11 @@ discard block |
||
111 | 111 | ); |
112 | 112 | |
113 | 113 | $tokenRow = $queryTable->getRow(0); |
114 | - $token = '2-' . $tokenRow['token']; |
|
114 | + $token = '2-'.$tokenRow['token']; |
|
115 | 115 | |
116 | - $u->confirm_email($token,false); |
|
116 | + $u->confirm_email($token, false); |
|
117 | 117 | |
118 | - $this->assertEquals( '[email protected]', $u->email(), 'confirming with token updates email address' ); |
|
118 | + $this->assertEquals('[email protected]', $u->email(), 'confirming with token updates email address'); |
|
119 | 119 | $tokenCount = $this->getConnection()->getRowCount('tokens', 'data = "1::[email protected]"'); |
120 | 120 | $this->assertEquals(0, $tokenCount, 'token deleted once email confirmed'); |
121 | 121 | |
@@ -131,15 +131,15 @@ discard block |
||
131 | 131 | $u = new THEUSER(); |
132 | 132 | $u->loggedin = 1; |
133 | 133 | |
134 | - $this->assertEquals( '[email protected]', $u->email(), 'confirming inital email address' ); |
|
134 | + $this->assertEquals('[email protected]', $u->email(), 'confirming inital email address'); |
|
135 | 135 | |
136 | 136 | $tokenCount = $this->getConnection()->getRowCount('tokens', 'data = "1::[email protected]"'); |
137 | 137 | $this->assertEquals(1, $tokenCount, 'correct number of email confirm tokens'); |
138 | 138 | |
139 | 139 | $token = '2-lkdsjafhsadjhf'; |
140 | 140 | |
141 | - $u->confirm_email($token,false); |
|
142 | - $this->assertEquals( '[email protected]', $u->email(), 'expired token does not update email address' ); |
|
141 | + $u->confirm_email($token, false); |
|
142 | + $this->assertEquals('[email protected]', $u->email(), 'expired token does not update email address'); |
|
143 | 143 | |
144 | 144 | $tokenCount = $this->getConnection()->getRowCount('tokens', 'data = "1::[email protected]"'); |
145 | 145 | $this->assertEquals(1, $tokenCount, 'correct number of email confirm tokens'); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | $this->assertContains('<span class="party Lab">Labour</span>', $page); |
35 | 35 | } |
36 | 36 | |
37 | - public function testSittingMLA() |
|
37 | + public function testSittingMLA() |
|
38 | 38 | { |
39 | 39 | $page = $this->fetch_page( array( 'pid' => 4, 'url' => '/mp/4/test_current-mla/test_northern_ireland_constituency' ) ); |
40 | 40 | $this->assertContains('Test Current-MLA', $page); |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | /** |
64 | 64 | * Ensure that the Speaker is given the correct constituency. |
65 | 65 | */ |
66 | - public function testSpeaker() |
|
66 | + public function testSpeaker() |
|
67 | 67 | { |
68 | 68 | $page = $this->fetch_page( array( 'pid' => 13, 'url' => '/mp/13/test_speaker/buckingham' ) ); |
69 | 69 | $this->assertContains('<span class="party SPK">Speaker</span>', $page); |
@@ -21,14 +21,14 @@ discard block |
||
21 | 21 | |
22 | 22 | public function testQueenie() |
23 | 23 | { |
24 | - $page = $this->fetch_page( array( 'royal' => 1, 'n' => 'elizabeth_the_second' ) ); |
|
24 | + $page = $this->fetch_page(array('royal' => 1, 'n' => 'elizabeth_the_second')); |
|
25 | 25 | $this->assertContains('Elizabeth the Second', $page); |
26 | 26 | $this->assertContains('Coronated on 2 June 1953', $page); |
27 | 27 | } |
28 | 28 | |
29 | 29 | public function testSittingMP() |
30 | 30 | { |
31 | - $page = $this->fetch_page( array( 'pid' => 2, 'url' => '/mp/2/test_current-mp/test_westminster_constituency' ) ); |
|
31 | + $page = $this->fetch_page(array('pid' => 2, 'url' => '/mp/2/test_current-mp/test_westminster_constituency')); |
|
32 | 32 | $this->assertContains('Test Current-MP', $page); |
33 | 33 | $this->assertContains('<span class="constituency">Test Westminster Constituency</span>', $page); |
34 | 34 | $this->assertContains('<span class="party Lab">Labour</span>', $page); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | |
37 | 37 | public function testSittingMLA() |
38 | 38 | { |
39 | - $page = $this->fetch_page( array( 'pid' => 4, 'url' => '/mp/4/test_current-mla/test_northern_ireland_constituency' ) ); |
|
39 | + $page = $this->fetch_page(array('pid' => 4, 'url' => '/mp/4/test_current-mla/test_northern_ireland_constituency')); |
|
40 | 40 | $this->assertContains('Test Current-MLA', $page); |
41 | 41 | $this->assertContains('<span class="constituency">Test Northern Ireland Constituency</span>', $page); |
42 | 42 | $this->assertContains('<span class="party SinnFéin">Sinn Féin</span>', $page); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | */ |
48 | 48 | public function testSittingSinnFeinMP() |
49 | 49 | { |
50 | - $page = $this->fetch_page( array( 'pid' => 15, 'url' => '/mp/15/test_current-sf-mp/test_westminster_constituency' ) ); |
|
50 | + $page = $this->fetch_page(array('pid' => 15, 'url' => '/mp/15/test_current-sf-mp/test_westminster_constituency')); |
|
51 | 51 | $this->assertContains('Sinn Féin MPs do not take their seats in Parliament.', $page); |
52 | 52 | } |
53 | 53 | |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | */ |
57 | 57 | public function testSittingNonSinnFeinMP() |
58 | 58 | { |
59 | - $page = $this->fetch_page( array( 'pid' => 2, 'url' => '/mp/2/test_current-mp/test_westminster_constituency' ) ); |
|
59 | + $page = $this->fetch_page(array('pid' => 2, 'url' => '/mp/2/test_current-mp/test_westminster_constituency')); |
|
60 | 60 | $this->assertNotContains('Sinn Féin MPs do not take their seats in Parliament.', $page); |
61 | 61 | } |
62 | 62 | |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | */ |
66 | 66 | public function testSpeaker() |
67 | 67 | { |
68 | - $page = $this->fetch_page( array( 'pid' => 13, 'url' => '/mp/13/test_speaker/buckingham' ) ); |
|
68 | + $page = $this->fetch_page(array('pid' => 13, 'url' => '/mp/13/test_speaker/buckingham')); |
|
69 | 69 | $this->assertContains('<span class="party SPK">Speaker</span>', $page); |
70 | 70 | } |
71 | 71 | |
@@ -75,25 +75,25 @@ discard block |
||
75 | 75 | # makes sure it is empty in case there's something hanging |
76 | 76 | # about in memcached |
77 | 77 | $banner->set_text(''); |
78 | - $page = $this->fetch_page( array( 'url' => '/' ) ); |
|
78 | + $page = $this->fetch_page(array('url' => '/')); |
|
79 | 79 | $this->assertNotContains('<div class="banner">', $page); |
80 | 80 | $this->assertNotContains('This is a banner', $page); |
81 | 81 | |
82 | 82 | $banner->set_text('This is a banner'); |
83 | - $page = $this->fetch_page( array( 'url' => '/' ) ); |
|
83 | + $page = $this->fetch_page(array('url' => '/')); |
|
84 | 84 | $this->assertContains('This is a banner', $page); |
85 | 85 | |
86 | 86 | $banner->set_text(''); |
87 | - $page = $this->fetch_page( array( 'url' => '/' ) ); |
|
87 | + $page = $this->fetch_page(array('url' => '/')); |
|
88 | 88 | $this->assertNotContains('<div class="banner">', $page); |
89 | 89 | $this->assertNotContains('This is a banner', $page); |
90 | 90 | } |
91 | 91 | |
92 | 92 | public function testNewMPMessage() { |
93 | - $page = $this->fetch_page( array( 'pid' => 17, 'url' => '/mp/17/recent_mp/test_westminster_constituency' ) ); |
|
93 | + $page = $this->fetch_page(array('pid' => 17, 'url' => '/mp/17/recent_mp/test_westminster_constituency')); |
|
94 | 94 | $this->assertNotContains('is a recently elected MP', $page); |
95 | 95 | $this->db->query('UPDATE member SET entered_house = NOW() WHERE person_id = 17'); |
96 | - $page = $this->fetch_page( array( 'pid' => 17, 'url' => '/mp/17/recent_mp/test_westminster_constituency' ) ); |
|
96 | + $page = $this->fetch_page(array('pid' => 17, 'url' => '/mp/17/recent_mp/test_westminster_constituency')); |
|
97 | 97 | $this->assertContains('is a recently elected MP', $page); |
98 | 98 | } |
99 | 99 |
@@ -17,8 +17,8 @@ discard block |
||
17 | 17 | /** |
18 | 18 | * Ensures the database is prepared and the glossary class is included for every test. |
19 | 19 | */ |
20 | - public function setUp() |
|
21 | - { |
|
20 | + public function setUp() |
|
21 | + { |
|
22 | 22 | parent::setUp(); |
23 | 23 | |
24 | 24 | include_once('www/includes/easyparliament/glossary.php'); |
@@ -27,10 +27,10 @@ discard block |
||
27 | 27 | /** |
28 | 28 | * Test that glossarising a single word works as expected. |
29 | 29 | */ |
30 | - public function testGlossariseNormal() |
|
30 | + public function testGlossariseNormal() |
|
31 | 31 | { |
32 | 32 | $args['sort'] = "regexp_replace"; |
33 | - $glossary = new GLOSSARY($args); |
|
33 | + $glossary = new GLOSSARY($args); |
|
34 | 34 | |
35 | 35 | $this->assertEquals('<a href="/glossary/?gl=1" title="In a general election, each Constituency chooses an MP to represent them...." class="glossary">constituency</a>', $glossary->glossarise('constituency')); |
36 | 36 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | public function testGlossariseInLink() |
42 | 42 | { |
43 | 43 | $args['sort'] = "regexp_replace"; |
44 | - $glossary = new GLOSSARY($args); |
|
44 | + $glossary = new GLOSSARY($args); |
|
45 | 45 | |
46 | 46 | $this->assertEquals('<a href="#">constituency</a>', $glossary->glossarise('<a href="#">constituency</a>')); |
47 | 47 | } |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | public function testGlossariseInString() |
53 | 53 | { |
54 | 54 | $args['sort'] = "regexp_replace"; |
55 | - $glossary = new GLOSSARY($args); |
|
55 | + $glossary = new GLOSSARY($args); |
|
56 | 56 | |
57 | 57 | $this->assertEquals('fooconstituencybar', $glossary->glossarise('fooconstituencybar')); |
58 | 58 | } |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | public function testGlossariseInSpacedString() |
64 | 64 | { |
65 | 65 | $args['sort'] = "regexp_replace"; |
66 | - $glossary = new GLOSSARY($args); |
|
66 | + $glossary = new GLOSSARY($args); |
|
67 | 67 | |
68 | 68 | $this->assertEquals('foo <a href="/glossary/?gl=1" title="In a general election, each Constituency chooses an MP to represent them...." class="glossary">constituency</a> bar', $glossary->glossarise('foo constituency bar')); |
69 | 69 | } |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | public function testWikipediaLinkNormal() |
75 | 75 | { |
76 | 76 | $args['sort'] = "regexp_replace"; |
77 | - $glossary = new GLOSSARY($args); |
|
77 | + $glossary = new GLOSSARY($args); |
|
78 | 78 | |
79 | 79 | $this->assertEquals('<a href="https://en.wikipedia.org/wiki/MP">MP</a>', $glossary->glossarise('MP')); |
80 | 80 | } |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | public function testWikipediaLinkInLink() |
86 | 86 | { |
87 | 87 | $args['sort'] = "regexp_replace"; |
88 | - $glossary = new GLOSSARY($args); |
|
88 | + $glossary = new GLOSSARY($args); |
|
89 | 89 | |
90 | 90 | $this->assertEquals('<a href="#">MP</a>', $glossary->glossarise('<a href="#">MP</a>')); |
91 | 91 | } |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | public function testWikipediaLinkInString() |
97 | 97 | { |
98 | 98 | $args['sort'] = "regexp_replace"; |
99 | - $glossary = new GLOSSARY($args); |
|
99 | + $glossary = new GLOSSARY($args); |
|
100 | 100 | |
101 | 101 | $this->assertEquals('fooMPbar', $glossary->glossarise('fooMPbar')); |
102 | 102 | } |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | public function testWikipediaLinkInSpacedString() |
108 | 108 | { |
109 | 109 | $args['sort'] = "regexp_replace"; |
110 | - $glossary = new GLOSSARY($args); |
|
110 | + $glossary = new GLOSSARY($args); |
|
111 | 111 | |
112 | 112 | $this->assertEquals('foo <a href="https://en.wikipedia.org/wiki/MP">MP</a> bar', $glossary->glossarise('foo MP bar')); |
113 | 113 | } |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | // TWFY Test Bootstrapper |
4 | 4 | |
5 | 5 | // Go get the Composer autoloader to make sure we've got the right PHPUnit extensions. |
6 | -require_once(dirname(__FILE__) . '/../vendor/autoload.php'); |
|
6 | +require_once(dirname(__FILE__).'/../vendor/autoload.php'); |
|
7 | 7 | |
8 | 8 | // Test to make sure we have the test DB environment variables. If not, this isn't testing, so abort. |
9 | 9 | // Define the DB connection constants before we do anything else. |
@@ -21,14 +21,14 @@ discard block |
||
21 | 21 | define('OPTION_TWFY_DB_NAME', $_SERVER['TWFY_TEST_DB_NAME']); |
22 | 22 | |
23 | 23 | // Define the base directory |
24 | - define ("BASEDIR", dirname(__FILE__) . '/../www/docs'); |
|
24 | + define("BASEDIR", dirname(__FILE__).'/../www/docs'); |
|
25 | 25 | |
26 | 26 | # point to the default mapit |
27 | 27 | define('OPTION_MAPIT_URL', 'https://mapit.mysociety.org/'); |
28 | 28 | |
29 | 29 | // If there isn't a config file (most likely this is running an automated test) copy one in. |
30 | - if ( ! file_exists(dirname(__FILE__) . '/../conf/general')) { |
|
31 | - copy(dirname(__FILE__) . '/../conf/general-example', dirname(__FILE__) . '/../conf/general'); |
|
30 | + if (!file_exists(dirname(__FILE__).'/../conf/general')) { |
|
31 | + copy(dirname(__FILE__).'/../conf/general-example', dirname(__FILE__).'/../conf/general'); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | } else { |
@@ -8,9 +8,9 @@ discard block |
||
8 | 8 | // Test to make sure we have the test DB environment variables. If not, this isn't testing, so abort. |
9 | 9 | // Define the DB connection constants before we do anything else. |
10 | 10 | if ( |
11 | - isset($_SERVER['TWFY_TEST_DB_HOST']) AND |
|
12 | - isset($_SERVER['TWFY_TEST_DB_USER']) AND |
|
13 | - isset($_SERVER['TWFY_TEST_DB_PASS']) AND |
|
11 | + isset($_SERVER['TWFY_TEST_DB_HOST']) and |
|
12 | + isset($_SERVER['TWFY_TEST_DB_USER']) and |
|
13 | + isset($_SERVER['TWFY_TEST_DB_PASS']) and |
|
14 | 14 | isset($_SERVER['TWFY_TEST_DB_NAME']) |
15 | 15 | ) { |
16 | 16 | |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | } |
38 | 38 | |
39 | 39 | // Explicitly declare we're in testing (avoids trying deploy-only things) |
40 | -define('TESTING', TRUE); |
|
40 | +define('TESTING', true); |
|
41 | 41 | |
42 | 42 | // Load up the init script (handles the rest of the config, DB connection etc) |
43 | 43 | include_once('www/includes/easyparliament/init.php'); |