Completed
Pull Request — master (#26)
by Lars
14:13
created
tests/unit/Keyword/KeywordTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 require_once 'Intraface/shared/keyword/Keyword.php';
3
-require_once dirname(__FILE__) . '/../Stub/Keyword.php';
3
+require_once dirname(__FILE__).'/../Stub/Keyword.php';
4 4
 
5 5
 class KeywordTest extends PHPUnit_Framework_TestCase
6 6
 {
Please login to merge, or discard this patch.
tests/unit/Keyword/KeywordStringAppendTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 require_once 'Intraface/shared/keyword/Keyword.php';
3
-require_once dirname(__FILE__) . '/../Stub/Keyword.php';
3
+require_once dirname(__FILE__).'/../Stub/Keyword.php';
4 4
 
5 5
 class KeywordStringAppendTest extends PHPUnit_Framework_TestCase
6 6
 {
Please login to merge, or discard this patch.
tests/unit/Product/ProductTest.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -88,14 +88,14 @@  discard block
 block discarded – undo
88 88
         $product = new Product($this->kernel, $result);
89 89
         $name = 'Test';
90 90
         $price = 20;
91
-        if (!$result = $product->save(array('number' => $values['number'], 'name' => $name . '2', 'price' => $price, 'unit' => 1))) {
91
+        if (!$result = $product->save(array('number' => $values['number'], 'name' => $name.'2', 'price' => $price, 'unit' => 1))) {
92 92
             $product->error->view();
93 93
         }
94 94
         $this->assertTrue($result > 0);
95 95
         $values = $product->get();
96 96
 
97 97
         $this->assertEquals(1, $values['number']);
98
-        $this->assertEquals($name . '2', $values['name']);
98
+        $this->assertEquals($name.'2', $values['name']);
99 99
         $this->assertEquals($price, $values['price']);
100 100
     }
101 101
 
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
         try {
283 283
             $product->setAttributeGroup(1);
284 284
             $this->assertTrue(false, 'An excpetion is not thrown');
285
-        } catch(Exception $e) {
285
+        } catch (Exception $e) {
286 286
             $this->assertEquals('You can not set attribute group for a product without variations!', $e->getMessage());
287 287
         }
288 288
     }
@@ -410,11 +410,11 @@  discard block
 block discarded – undo
410 410
 
411 411
     function testGetPriceInCurrency()
412 412
     {
413
-        require_once dirname(__FILE__) .'/../Stub/Fake/Intraface/modules/currency/Currency.php';
413
+        require_once dirname(__FILE__).'/../Stub/Fake/Intraface/modules/currency/Currency.php';
414 414
         $currency = new Fake_Intraface_modules_currency_Currency;
415
-        require_once dirname(__FILE__) .'/../Stub/Fake/Intraface/modules/currency/Currency/ExchangeRate.php';
415
+        require_once dirname(__FILE__).'/../Stub/Fake/Intraface/modules/currency/Currency/ExchangeRate.php';
416 416
         $currency->product_price_exchange_rate = new Fake_Intraface_modules_currency_Currency_ExchangeRate;
417
-        require_once dirname(__FILE__) .'/../Stub/Fake/Ilib/Variable/Float.php';
417
+        require_once dirname(__FILE__).'/../Stub/Fake/Ilib/Variable/Float.php';
418 418
         $currency->product_price_exchange_rate->rate = new Fake_Ilib_Variable_Float(745.23);
419 419
 
420 420
         $product = new Product($this->kernel);
Please login to merge, or discard this patch.
tests/unit/setup_database.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -8,11 +8,11 @@
 block discarded – undo
8 8
 }
9 9
 
10 10
 define('SERVER_STATUS', 'DEVELOPEMENT');
11
-define('DB_DSN', 'mysql://root:' . $pass . '@localhost/intraface_test');
11
+define('DB_DSN', 'mysql://root:'.$pass.'@localhost/intraface_test');
12 12
 define('DB_NAME', 'intraface_test');
13 13
 
14
-require_once dirname(__FILE__) . '/../../vendor/autoload.php';
15
-$install_class = dirname(__FILE__). '/../../install/Install.php';
14
+require_once dirname(__FILE__).'/../../vendor/autoload.php';
15
+$install_class = dirname(__FILE__).'/../../install/Install.php';
16 16
 if (!file_exists($install_class)) {
17 17
     throw new Exception('The install class is not present. Probably because you should not run it now!');
18 18
     exit;
Please login to merge, or discard this patch.
tests/unit/Common/KernelTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -160,7 +160,7 @@
 block discarded – undo
160 160
         $db = MDB2::singleton(DB_DSN);
161 161
         $result = $db->query('SELECT * FROM module');
162 162
         if (PEAR::isError($result)) {
163
-            die($result->getMessage() . $result->getUserInfo());
163
+            die($result->getMessage().$result->getUserInfo());
164 164
         }
165 165
 
166 166
         $kernel = new Intraface_Kernel;
Please login to merge, or discard this patch.
tests/unit/Common/RedirectTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 
61 61
     function tearDown()
62 62
     {
63
-        $result = $this->db->exec('TRUNCATE ' . $this->table);
63
+        $result = $this->db->exec('TRUNCATE '.$this->table);
64 64
     }
65 65
 
66 66
     function testConstruction()
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
         $destination_url = 'http://example.dk/page.php';
78 78
         $url = $redirect->setDestination($destination_url, $return_url);
79 79
         $parameter_to_return_with = 'add_contact_id'; // activates the parameter sent back to the return page
80
-        $this->assertEquals($destination_url . '?redirect_id=1', $url);
80
+        $this->assertEquals($destination_url.'?redirect_id=1', $url);
81 81
     }
82 82
 /*
83 83
     function testRecieveRedirectAndGetRedirect()
Please login to merge, or discard this patch.
tests/unit/Common/ModuleHandlerTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
         $db = MDB2::singleton(DB_DSN);
56 56
         $result = $db->query('SELECT * FROM module');
57 57
         if (PEAR::isError($result)) {
58
-            die($result->getMessage() . $result->getUserInfo());
58
+            die($result->getMessage().$result->getUserInfo());
59 59
         }
60 60
 
61 61
         $this->assertTrue(is_array($this->handler->getModules(MDB2::singleton(DB_DSN))));
Please login to merge, or discard this patch.
tests/unit/Common/DateTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
     {
17 17
         $date = new Intraface_Date('10-10');
18 18
         $this->assertTrue($date->convert2db());
19
-        $this->assertEquals(date('Y') . '-10-10', $date->get());
19
+        $this->assertEquals(date('Y').'-10-10', $date->get());
20 20
     }
21 21
 
22 22
     function testDateCanTakeSpacesAsSplittersDatabaseFormat()
Please login to merge, or discard this patch.
tests/unit/Common/DBQueryTest.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 
18 18
         $result = $this->db->exec('TRUNCATE TABLE dbquery_result');
19 19
 
20
-        $result = $this->db->exec('DROP TABLE ' . $this->table);
20
+        $result = $this->db->exec('DROP TABLE '.$this->table);
21 21
         /*
22 22
          TODO: DROP THE TABLE IF IT EXISTS
23 23
 
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
         }
29 29
         */
30 30
 
31
-        $result = $this->db->exec('CREATE TABLE ' . $this->table . '(
31
+        $result = $this->db->exec('CREATE TABLE '.$this->table.'(
32 32
             id int(11) NOT NULL auto_increment, name varchar(255) NOT NULL, PRIMARY KEY  (id))');
33 33
 
34 34
         if (PEAR::isError($result)) {
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 
55 55
     function createPost($post)
56 56
     {
57
-        $result = $this->db->exec('INSERT INTO ' . $this->table . ' (name) VALUES ('.$this->db->quote($post, 'text').')');
57
+        $result = $this->db->exec('INSERT INTO '.$this->table.' (name) VALUES ('.$this->db->quote($post, 'text').')');
58 58
         if (PEAR::isError($result)) {
59 59
             die($result->getUserInfo());
60 60
         }
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 
63 63
     function tearDown()
64 64
     {
65
-        $result = $this->db->exec('DROP TABLE ' . $this->table);
65
+        $result = $this->db->exec('DROP TABLE '.$this->table);
66 66
     }
67 67
 
68 68
     ///////////////////////////////////////////////////////////////////////////
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
         $this->assertEquals($paging_name, $dbquery->getPagingVarName());
106 106
 
107 107
         $paging = $dbquery->getPaging();
108
-        $expected_offset = array(1=>0, 2=>2, 3=>4, 4=>6, 5=>8, 6=>10, 7=>12, 8=>14, 9=>16,10=>18,11=>20);
108
+        $expected_offset = array(1=>0, 2=>2, 3=>4, 4=>6, 5=>8, 6=>10, 7=>12, 8=>14, 9=>16, 10=>18, 11=>20);
109 109
         $this->assertEquals($expected_offset, $paging['offset']);
110 110
         $this->assertEquals(0, $paging['previous']);
111 111
         $this->assertEquals(2, $paging['next']);
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 
120 120
         $db = $dbquery->getRecordset('id, name');
121 121
         $i = 0;
122
-        while($db->nextRecord()) {
122
+        while ($db->nextRecord()) {
123 123
             $result[$i]['id'] = $db->f('id');
124 124
             $result[$i]['name'] = $db->f('name');
125 125
             $i++;
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
         $dbquery->storeResult("use_stored", 'unittest', "toplevel");
142 142
         $db = $dbquery->getRecordset('id, name');
143 143
         $i = 0;
144
-        while($db->nextRecord()) {
144
+        while ($db->nextRecord()) {
145 145
             $result[$i]['id'] = $db->f('id');
146 146
             $result[$i]['name'] = $db->f('name');
147 147
             $i++;
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
         $dbquery->storeResult("use_stored", 'unittest', "toplevel");
169 169
         $db = $dbquery->getRecordset('id, name');
170 170
         $i = 0;
171
-        while($db->nextRecord()) {
171
+        while ($db->nextRecord()) {
172 172
             $result[$i]['id'] = $db->f('id');
173 173
             $result[$i]['name'] = $db->f('name');
174 174
             $i++;
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
         $dbquery->storeResult("use_stored", 'unittest', "toplevel");
196 196
         $db = $dbquery->getRecordset('id, name');
197 197
         $i = 0;
198
-        while($db->nextRecord()) {
198
+        while ($db->nextRecord()) {
199 199
             $result[$i]['id'] = $db->f('id');
200 200
             $result[$i]['name'] = $db->f('name');
201 201
             $i++;
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
         $dbquery->storeResult("use_stored", 'unittest', "toplevel");
223 223
         $db = $dbquery->getRecordset('id, name');
224 224
         $i = 0;
225
-        while($db->nextRecord()) {
225
+        while ($db->nextRecord()) {
226 226
             $result[$i]['id'] = $db->f('id');
227 227
             $result[$i]['name'] = $db->f('name');
228 228
             $i++;
Please login to merge, or discard this patch.