Completed
Pull Request — master (#21)
by Lars
14:31
created
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/Debtor/InvoiceTest.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -127,15 +127,15 @@  discard block
 block discarded – undo
127 127
         $invoice = $this->createAnInvoiceWithOneItem();
128 128
         $invoice->setStatus('sent');
129 129
         $year = $this->createAccountingYear();
130
-        $this->assertTrue($invoice->state($year, 1, '10-01-' . date('Y'), new Stub_Translation), $invoice->error->view());
130
+        $this->assertTrue($invoice->state($year, 1, '10-01-'.date('Y'), new Stub_Translation), $invoice->error->view());
131 131
 
132 132
         $voucher = Voucher::factory($year, 1);
133 133
 
134 134
         $expected = array(
135 135
             0 => array(
136 136
                 'id' => 1,
137
-                'date_dk' => '10-01-' . date('Y'),
138
-                'date' => date('Y') . '-01-10',
137
+                'date_dk' => '10-01-'.date('Y'),
138
+                'date' => date('Y').'-01-10',
139 139
                 'text' => 'invoice #1 - test',
140 140
                 'debet' => 200.00,
141 141
                 'credit' => 0.00,
@@ -149,8 +149,8 @@  discard block
 block discarded – undo
149 149
             ),
150 150
             1 => array(
151 151
                 'id' => 2,
152
-                'date_dk' => '10-01-' . date('Y'),
153
-                'date' =>  date('Y') . '-01-10',
152
+                'date_dk' => '10-01-'.date('Y'),
153
+                'date' =>  date('Y').'-01-10',
154 154
                 'text' => 'invoice #1 - test',
155 155
                 'debet' => 0.00,
156 156
                 'credit' => 200.00,
@@ -164,8 +164,8 @@  discard block
 block discarded – undo
164 164
             ),
165 165
             2 => array(
166 166
                 'id' => 3,
167
-                'date_dk' => '10-01-' . date('Y'),
168
-                'date' => date('Y') . '-01-10',
167
+                'date_dk' => '10-01-'.date('Y'),
168
+                'date' => date('Y').'-01-10',
169 169
                 'text' => 'invoice #1 - Moms, udgående, salg',
170 170
                 'debet' => 50.00,
171 171
                 'credit' => 0.00,
@@ -179,8 +179,8 @@  discard block
 block discarded – undo
179 179
             ),
180 180
             3 => array(
181 181
                 'id' => 4,
182
-                'date_dk' => '10-01-' . date('Y'),
183
-                'date' => date('Y') . '-01-10',
182
+                'date_dk' => '10-01-'.date('Y'),
183
+                'date' => date('Y').'-01-10',
184 184
                 'text' => 'invoice #1 - Moms, udgående, salg',
185 185
                 'debet' => 0.00,
186 186
                 'credit' => 50.00,
@@ -204,15 +204,15 @@  discard block
 block discarded – undo
204 204
         $invoice = $this->createAnInvoiceWithOneItem(array('product_vat' => 0, 'product_state_account_id' => 1120));
205 205
         $invoice->setStatus('sent');
206 206
         $year = $this->createAccountingYear();
207
-        $this->assertTrue($invoice->state($year, 1, '10-01-' . date('Y'), new Stub_Translation), $invoice->error->view());
207
+        $this->assertTrue($invoice->state($year, 1, '10-01-'.date('Y'), new Stub_Translation), $invoice->error->view());
208 208
 
209 209
         $voucher = Voucher::factory($year, 1);
210 210
 
211 211
         $expected = array(
212 212
             0 => array(
213 213
                 'id' => 1,
214
-                'date_dk' => '10-01-' . date('Y'),
215
-                'date' => date('Y') . '-01-10',
214
+                'date_dk' => '10-01-'.date('Y'),
215
+                'date' => date('Y').'-01-10',
216 216
                 'text' => 'invoice #1 - test',
217 217
                 'debet' => 200.00,
218 218
                 'credit' => 0.00,
@@ -226,8 +226,8 @@  discard block
 block discarded – undo
226 226
             ),
227 227
             1 => array(
228 228
                 'id' => 2,
229
-                'date_dk' => '10-01-' . date('Y'),
230
-                'date' => date('Y') . '-01-10',
229
+                'date_dk' => '10-01-'.date('Y'),
230
+                'date' => date('Y').'-01-10',
231 231
                 'text' => 'invoice #1 - test',
232 232
                 'debet' => 0.00,
233 233
                 'credit' => 200.00,
Please login to merge, or discard this patch.
tests/unit/Debtor/CreditNoteTest.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -130,15 +130,15 @@  discard block
 block discarded – undo
130 130
         $creditnote = $this->createAnCreditNoteWithOneItem();
131 131
         $creditnote->setStatus('sent');
132 132
         $year = $this->createAccountingYear();
133
-        $this->assertTrue($creditnote->state($year, 1, '10-01-' . date('Y'), new Stub_Translation), 'state: '.$creditnote->error->view());
133
+        $this->assertTrue($creditnote->state($year, 1, '10-01-'.date('Y'), new Stub_Translation), 'state: '.$creditnote->error->view());
134 134
 
135 135
         $voucher = Voucher::factory($year, 1);
136 136
 
137 137
         $expected = array(
138 138
             0 => array(
139 139
                 'id' => 1,
140
-                'date_dk' => '10-01-' . date('Y'),
141
-                'date' => date('Y') . '-01-10',
140
+                'date_dk' => '10-01-'.date('Y'),
141
+                'date' => date('Y').'-01-10',
142 142
                 'text' => 'credit note #1 - test',
143 143
                 'debet' => 200,
144 144
                 'credit' => 0,
@@ -152,8 +152,8 @@  discard block
 block discarded – undo
152 152
             ),
153 153
             1 => array(
154 154
                 'id' => 2,
155
-                'date_dk' => '10-01-' . date('Y'),
156
-                'date' => date('Y'). '-01-10',
155
+                'date_dk' => '10-01-'.date('Y'),
156
+                'date' => date('Y').'-01-10',
157 157
                 'text' => 'credit note #1 - test',
158 158
                 'debet' => 0,
159 159
                 'credit' => 200,
@@ -167,8 +167,8 @@  discard block
 block discarded – undo
167 167
             ),
168 168
             2 => array(
169 169
                 'id' => 3,
170
-                'date_dk' => '10-01-' . date('Y'),
171
-                'date' => date('Y') . '-01-10',
170
+                'date_dk' => '10-01-'.date('Y'),
171
+                'date' => date('Y').'-01-10',
172 172
                 'text' => 'credit note #1 - Moms, udgående, salg',
173 173
                 'debet' => 50.00,
174 174
                 'credit' => 0.00,
@@ -182,8 +182,8 @@  discard block
 block discarded – undo
182 182
             ),
183 183
             3 => array(
184 184
                 'id' => 4,
185
-                'date_dk' => '10-01-' . date('Y'),
186
-                'date' => date('Y'). '-01-10',
185
+                'date_dk' => '10-01-'.date('Y'),
186
+                'date' => date('Y').'-01-10',
187 187
                 'text' => 'credit note #1 - Moms, udgående, salg',
188 188
                 'debet' => 0,
189 189
                 'credit' => 50,
@@ -207,15 +207,15 @@  discard block
 block discarded – undo
207 207
         $creditnote = $this->createAnCreditNoteWithOneItem(array('product_vat' => 0, 'product_state_account_id' => 1120));
208 208
         $creditnote->setStatus('sent');
209 209
         $year = $this->createAccountingYear();
210
-        $this->assertTrue($creditnote->state($year, 1, '10-01-' . date('Y'), new Stub_Translation), 'state: '.$creditnote->error->view());
210
+        $this->assertTrue($creditnote->state($year, 1, '10-01-'.date('Y'), new Stub_Translation), 'state: '.$creditnote->error->view());
211 211
 
212 212
         $voucher = Voucher::factory($year, 1);
213 213
 
214 214
         $expected = array(
215 215
             0 => array(
216 216
                 'id' => 1,
217
-                'date_dk' => '10-01-' . date('Y'),
218
-                'date' => date('Y') . '-01-10',
217
+                'date_dk' => '10-01-'.date('Y'),
218
+                'date' => date('Y').'-01-10',
219 219
                 'text' => 'credit note #1 - test',
220 220
                 'debet' => 200,
221 221
                 'credit' => 0,
@@ -229,8 +229,8 @@  discard block
 block discarded – undo
229 229
             ),
230 230
             1 => array(
231 231
                 'id' => 2,
232
-                'date_dk' => '10-01-' . date('Y'),
233
-                'date' => date('Y'). '-01-10',
232
+                'date_dk' => '10-01-'.date('Y'),
233
+                'date' => date('Y').'-01-10',
234 234
                 'text' => 'credit note #1 - test',
235 235
                 'debet' => 0,
236 236
                 'credit' => 200,
Please login to merge, or discard this patch.
tests/unit/Debtor/DebtorPdfTest.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 require_once 'Intraface/modules/debtor/Visitor/Pdf.php';
3
-require_once dirname(__FILE__) .'/stubs/Debtor.php';
4
-require_once dirname(__FILE__) .'/stubs/DebtorLongProductText.php';
5
-require_once dirname(__FILE__) .'/../Contact/stubs/Contact.php';
6
-require_once dirname(__FILE__) .'/../Contact/stubs/ContactPerson.php';
7
-require_once dirname(__FILE__) . '/../Stub/Fake/Ilib/Variable/Float.php';
3
+require_once dirname(__FILE__).'/stubs/Debtor.php';
4
+require_once dirname(__FILE__).'/stubs/DebtorLongProductText.php';
5
+require_once dirname(__FILE__).'/../Contact/stubs/Contact.php';
6
+require_once dirname(__FILE__).'/../Contact/stubs/ContactPerson.php';
7
+require_once dirname(__FILE__).'/../Stub/Fake/Ilib/Variable/Float.php';
8 8
 
9 9
 class DebtorPdfTest extends PHPUnit_Framework_TestCase
10 10
 {
11 11
     function setup()
12 12
     {
13
-        $this->debtor_pdf_path = TEST_PATH_TEMP . '/debtor.pdf';
13
+        $this->debtor_pdf_path = TEST_PATH_TEMP.'/debtor.pdf';
14 14
         $this->tearDown();
15 15
     }
16 16
 
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         $debtor = $this->createDebtor();
60 60
         $pdf->visit($debtor);
61 61
         $pdf->output('file', $this->debtor_pdf_path);
62
-        $expected = file_get_contents(dirname(__FILE__) .'/expected_debtor.pdf', 1);
62
+        $expected = file_get_contents(dirname(__FILE__).'/expected_debtor.pdf', 1);
63 63
         $actual = file_get_contents($this->debtor_pdf_path);
64 64
         $this->assertEquals(strlen($expected), strlen($actual));
65 65
     }
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
         $debtor->values['payment_total'] = 2125;
75 75
         $pdf->visit($debtor);
76 76
         $pdf->output('file', $this->debtor_pdf_path);
77
-        $expected = file_get_contents(dirname(__FILE__) .'/expected_debtor_with_payment.pdf', 1);
77
+        $expected = file_get_contents(dirname(__FILE__).'/expected_debtor_with_payment.pdf', 1);
78 78
         $actual = file_get_contents($this->debtor_pdf_path);
79 79
         $this->assertEquals(strlen($expected), strlen($actual));
80 80
     }
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
         $debtor = $this->createDebtorLongProductText();
89 89
         $pdf->visit($debtor);
90 90
         $pdf->output('file', $this->debtor_pdf_path);
91
-        $expected = file_get_contents(dirname(__FILE__) .'/expected_debtor_with_long_text.pdf', 1);
91
+        $expected = file_get_contents(dirname(__FILE__).'/expected_debtor_with_long_text.pdf', 1);
92 92
         $actual = file_get_contents($this->debtor_pdf_path);
93 93
         $this->assertEquals(strlen($expected), strlen($actual));
94 94
     }
Please login to merge, or discard this patch.
tests/unit/Debtor/ReminderTest.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -218,15 +218,15 @@  discard block
 block discarded – undo
218 218
                 'checked_invoice' => array($this->createAnInvoice($contact_id))));
219 219
         $reminder->setStatus('sent');
220 220
         $year = $this->createAccountingYear();
221
-        $this->assertTrue($reminder->state($year, 1, '10-01-' . date('Y'), 1120, new Stub_Translation), $reminder->error->view());
221
+        $this->assertTrue($reminder->state($year, 1, '10-01-'.date('Y'), 1120, new Stub_Translation), $reminder->error->view());
222 222
 
223 223
         $voucher = Voucher::factory($year, 1);
224 224
 
225 225
         $expected = array(
226 226
             0 => array(
227 227
                 'id' => 1,
228
-                'date_dk' => '10-01-' . date('Y'),
229
-                'date' => date('Y') . '-01-10',
228
+                'date_dk' => '10-01-'.date('Y'),
229
+                'date' => date('Y').'-01-10',
230 230
                 'text' => 'reminder #1',
231 231
                 'debet' => 100.00,
232 232
                 'credit' => 0.00,
@@ -240,8 +240,8 @@  discard block
 block discarded – undo
240 240
             ),
241 241
             1 => array(
242 242
                 'id' => 2,
243
-                'date_dk' => '10-01-' . date('Y'),
244
-                'date' => date('Y') . '-01-10',
243
+                'date_dk' => '10-01-'.date('Y'),
244
+                'date' => date('Y').'-01-10',
245 245
                 'text' => 'reminder #1',
246 246
                 'debet' => 0.00,
247 247
                 'credit' => 100.00,
Please login to merge, or discard this patch.
tests/unit/Debtor/DebtorItemTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 require_once 'Intraface/modules/debtor/DebtorItem.php';
3 3
 require_once 'Intraface/functions.php';
4
-require_once dirname(__FILE__) .'/stubs/Debtor.php';
4
+require_once dirname(__FILE__).'/stubs/Debtor.php';
5 5
 
6 6
 class DebtorItemTest extends PHPUnit_Framework_TestCase
7 7
 {
Please login to merge, or discard this patch.
tests/unit/Stub/Intranet.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
 
11 11
     function get($key = '')
12 12
     {
13
-        $info = array('name' => 'Intranetname', 'contact_person' => '','id' => 1, 'public_key' => 'somepublickey', 'identifier' => 'intraface');
13
+        $info = array('name' => 'Intranetname', 'contact_person' => '', 'id' => 1, 'public_key' => 'somepublickey', 'identifier' => 'intraface');
14 14
         if (empty($key)) {
15 15
             return $info;
16 16
         } else {
Please login to merge, or discard this patch.
tests/unit/Filehandler/FileHandlerTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
     {
12 12
         $db = MDB2::singleton(DB_DSN);
13 13
         $db->query('TRUNCATE file_handler');
14
-        fht_deltree(PATH_UPLOAD . '1');
14
+        fht_deltree(PATH_UPLOAD.'1');
15 15
     }
16 16
 
17 17
     function createKernel()
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
     {
79 79
         $fh = new FileHandler($this->createKernel());
80 80
         // first we make a copy of the file as it is moved by upload.
81
-        copy(dirname(__FILE__) . '/wideonball.jpg', PATH_UPLOAD.'wideonball.jpg');
81
+        copy(dirname(__FILE__).'/wideonball.jpg', PATH_UPLOAD.'wideonball.jpg');
82 82
         $id = $fh->save(PATH_UPLOAD.'wideonball.jpg', 'Filename');
83 83
         $fh->error->view();
84 84
         $this->assertTrue($id > 0);
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
     {
89 89
         $fh = new FileHandler($this->createKernel());
90 90
         // first we make a copy of the file as it is moved by upload.
91
-        copy(dirname(__FILE__) . '/wideonball.jpg', PATH_UPLOAD.'wideonball.jpg');
91
+        copy(dirname(__FILE__).'/wideonball.jpg', PATH_UPLOAD.'wideonball.jpg');
92 92
         $id = $fh->save(PATH_UPLOAD.'wideonball.jpg', 'Filename');
93 93
         $fh->load();
94 94
         $this->assertEquals(50, strlen($fh->get('access_key')));
Please login to merge, or discard this patch.
tests/unit/Filehandler/TemporaryFileTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
 
11 11
     function __construct()
12 12
     {
13
-        $this->upload_path = PATH_UPLOAD.'1'. DIRECTORY_SEPARATOR;
13
+        $this->upload_path = PATH_UPLOAD.'1'.DIRECTORY_SEPARATOR;
14 14
         $this->tempdir_path = $this->upload_path.PATH_UPLOAD_TEMPORARY;
15 15
     }
16 16
 }
Please login to merge, or discard this patch.