@@ -60,7 +60,7 @@ discard block |
||
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 |
||
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() |
@@ -55,7 +55,7 @@ |
||
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)))); |
@@ -16,7 +16,7 @@ |
||
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() |
@@ -17,7 +17,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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++; |
@@ -127,15 +127,15 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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, |
@@ -130,15 +130,15 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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, |
@@ -1,16 +1,16 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -41,7 +41,7 @@ |
||
41 | 41 | } |
42 | 42 | function get($key = '') |
43 | 43 | { |
44 | - $info = array('name' => 'Intranetname', 'contact_person' => '','id' => 1); |
|
44 | + $info = array('name' => 'Intranetname', 'contact_person' => '', 'id' => 1); |
|
45 | 45 | if (empty($key)) { |
46 | 46 | return $info; |
47 | 47 | } else { |
@@ -218,15 +218,15 @@ discard block |
||
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 |
||
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, |