@@ -12,7 +12,7 @@ |
||
12 | 12 | { |
13 | 13 | $this->cmssite = $site; |
14 | 14 | $this->kernel = $site->kernel; |
15 | - $this->dbquery = new Intraface_DBQuery($this->kernel, 'cms_page', 'cms_page.intranet_id = '.$this->kernel->intranet->get('id').' AND cms_page.active = 1 AND site_id = ' . $this->cmssite->get('id')); |
|
15 | + $this->dbquery = new Intraface_DBQuery($this->kernel, 'cms_page', 'cms_page.intranet_id = '.$this->kernel->intranet->get('id').' AND cms_page.active = 1 AND site_id = '.$this->cmssite->get('id')); |
|
16 | 16 | } |
17 | 17 | function get() |
18 | 18 | { |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -require_once dirname(__FILE__) . '/../../vendor/autoload.php'; |
|
2 | +require_once dirname(__FILE__).'/../../vendor/autoload.php'; |
|
3 | 3 | |
4 | 4 | $writer = new Ilib_Testing_Selenium_Selenese_TestSuiteGenerator; |
5 | 5 | $writer->addReplacement('##path_test_root##', dirname(__FILE__)); |
@@ -5,11 +5,11 @@ discard block |
||
5 | 5 | define('DB_PASS', $GLOBALS['db_password']); |
6 | 6 | define('DB_USER', $GLOBALS['db_username']); |
7 | 7 | define('DB_NAME', $GLOBALS['db_name']); |
8 | -define('DB_DSN', 'mysql://'.DB_USER.':'.DB_PASS.'@'.DB_HOST.'/' . DB_NAME); |
|
9 | -define('PATH_ROOT', dirname(__FILE__) . '/../../src/'); |
|
10 | -define('PATH_INCLUDE_CONFIG', PATH_ROOT . 'Intraface/config/'); |
|
11 | -define('PATH_INCLUDE_MODULE', PATH_ROOT . 'Intraface/modules/'); |
|
12 | -define('PATH_INCLUDE_SHARED', PATH_ROOT . 'Intraface/shared/'); |
|
8 | +define('DB_DSN', 'mysql://'.DB_USER.':'.DB_PASS.'@'.DB_HOST.'/'.DB_NAME); |
|
9 | +define('PATH_ROOT', dirname(__FILE__).'/../../src/'); |
|
10 | +define('PATH_INCLUDE_CONFIG', PATH_ROOT.'Intraface/config/'); |
|
11 | +define('PATH_INCLUDE_MODULE', PATH_ROOT.'Intraface/modules/'); |
|
12 | +define('PATH_INCLUDE_SHARED', PATH_ROOT.'Intraface/shared/'); |
|
13 | 13 | define('CONNECTION_INTERNET', 'ONLINE'); |
14 | 14 | |
15 | 15 | if (!file_exists($GLOBALS['path_upload'])) { |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | define('FILE_VIEWER', ''); |
22 | 22 | define('PATH_WWW', ''); |
23 | 23 | define('IMAGE_LIBRARY', 'GD'); |
24 | -define('XMLRPC_SERVER_URL', 'http://privatekeyshouldbereplaced:something@' . $GLOBALS['xmlrpc_server_url']); |
|
24 | +define('XMLRPC_SERVER_URL', 'http://privatekeyshouldbereplaced:something@'.$GLOBALS['xmlrpc_server_url']); |
|
25 | 25 | |
26 | 26 | if (!file_exists($GLOBALS['test_path_temp'])) { |
27 | 27 | mkdir($GLOBALS['test_path_temp']); |
@@ -29,8 +29,8 @@ discard block |
||
29 | 29 | |
30 | 30 | // Directory to move files to temporary in tests |
31 | 31 | define('TEST_PATH_TEMP', $GLOBALS['test_path_temp']); |
32 | -require_once dirname(__FILE__) . '/../../vendor/autoload.php'; |
|
33 | -set_include_path(dirname(__FILE__) . '/' . PATH_SEPARATOR . dirname(__FILE__) . '/../../vendor/intraface/error/src/' . PATH_SEPARATOR . dirname(__FILE__) . '/../../vendor/troelskn/konstrukt/lib/' . PATH_SEPARATOR . PATH_ROOT. PATH_SEPARATOR . get_include_path()); |
|
32 | +require_once dirname(__FILE__).'/../../vendor/autoload.php'; |
|
33 | +set_include_path(dirname(__FILE__).'/'.PATH_SEPARATOR.dirname(__FILE__).'/../../vendor/intraface/error/src/'.PATH_SEPARATOR.dirname(__FILE__).'/../../vendor/troelskn/konstrukt/lib/'.PATH_SEPARATOR.PATH_ROOT.PATH_SEPARATOR.get_include_path()); |
|
34 | 34 | |
35 | 35 | $db = MDB2::singleton(DB_DSN); |
36 | 36 | $db->setOption('debug', 0); |
@@ -65,7 +65,7 @@ |
||
65 | 65 | function isIdentifierUnique($identifier) |
66 | 66 | { |
67 | 67 | $this->db = & MDB2::singleton(DB_DSN); |
68 | - $res =& $this->db->query("SELECT id FROM intranet WHERE identifier='".$this->db->escape($identifier, 'string')."' AND id != " . $this->db->escape($this->id, 'integer')); |
|
68 | + $res = & $this->db->query("SELECT id FROM intranet WHERE identifier='".$this->db->escape($identifier, 'string')."' AND id != ".$this->db->escape($this->id, 'integer')); |
|
69 | 69 | if ($res->numRows() > 0) { |
70 | 70 | return false; |
71 | 71 | } |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | $this->id = (int)$file_id; |
115 | 115 | $this->error = new Ilib_Error; |
116 | 116 | |
117 | - $this->upload_path = PATH_UPLOAD . $this->kernel->intranet->get('id') . '/'; |
|
117 | + $this->upload_path = PATH_UPLOAD.$this->kernel->intranet->get('id').'/'; |
|
118 | 118 | $this->tempdir_path = $this->upload_path.PATH_UPLOAD_TEMPORARY; |
119 | 119 | $this->file_viewer = FILE_VIEWER; |
120 | 120 | $this->www_path = PATH_WWW; |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | $this->loadMimeTypes(); |
261 | 261 | $this->value['file_type'] = $this->_getMimeType((int)$db->f('file_type_key')); |
262 | 262 | $this->value['is_image'] = $this->file_types[$this->get('file_type_key')]['image']; |
263 | - $this->value['file_path'] = $this->upload_path . $db->f('server_file_name'); |
|
263 | + $this->value['file_path'] = $this->upload_path.$db->f('server_file_name'); |
|
264 | 264 | |
265 | 265 | if (file_exists($this->get('file_path'))) { |
266 | 266 | $this->value['last_modified'] = filemtime($this->get('file_path')); |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | } |
408 | 408 | |
409 | 409 | $db = new DB_Sql; |
410 | - $deleted_file_name = $this->upload_path . '_deleted_' . $this->get('server_file_name'); |
|
410 | + $deleted_file_name = $this->upload_path.'_deleted_'.$this->get('server_file_name'); |
|
411 | 411 | if (file_exists($deleted_file_name)) { |
412 | 412 | if (!rename($deleted_file_name, $this->upload_path.$this->get('server_file_name'))) { |
413 | 413 | throw new Exception("Kunne ikke omdøbe filen i FileHandler->undelete()"); |
@@ -682,7 +682,7 @@ discard block |
||
682 | 682 | public function moveFromTemporary() |
683 | 683 | { |
684 | 684 | $db = new DB_Sql; |
685 | - $db->query("UPDATE file_handler SET temporary = 0 WHERE user_id = ".$this->kernel->user->get('id')." AND id = " . $this->id); |
|
685 | + $db->query("UPDATE file_handler SET temporary = 0 WHERE user_id = ".$this->kernel->user->get('id')." AND id = ".$this->id); |
|
686 | 686 | return true; |
687 | 687 | } |
688 | 688 |
@@ -39,11 +39,11 @@ discard block |
||
39 | 39 | { |
40 | 40 | $post_id = (int)$post_id; |
41 | 41 | $db = new DB_Sql; |
42 | - $db->query("SELECT voucher_id FROM accounting_post WHERE id = " . $post_id . " AND year_id = " . $year->get('id') . " AND intranet_id=" . $year->kernel->intranet->get('id')); |
|
42 | + $db->query("SELECT voucher_id FROM accounting_post WHERE id = ".$post_id." AND year_id = ".$year->get('id')." AND intranet_id=".$year->kernel->intranet->get('id')); |
|
43 | 43 | if (!$db->nextRecord()) { |
44 | 44 | return new Post(new Voucher($year)); |
45 | 45 | } |
46 | - $post = new Post(new Voucher($year, $db->f('voucher_id')), (int)$post_id); |
|
46 | + $post = new Post(new Voucher($year, $db->f('voucher_id')), (int)$post_id); |
|
47 | 47 | return $post; |
48 | 48 | |
49 | 49 | } |
@@ -51,13 +51,13 @@ discard block |
||
51 | 51 | public function getList($type = 'stated') |
52 | 52 | { |
53 | 53 | $db = new DB_Sql; |
54 | - $sql = "SELECT voucher.reference, post.id, post.text, post.voucher_id, post.date, post.account_id, post.debet, post.credit, post.stated, DATE_FORMAT(post.date, '%d-%m-%Y') AS date_dk FROM accounting_post post INNER JOIN accounting_voucher voucher ON post.voucher_id = voucher.id WHERE post.year_id = " . $this->voucher->year->get('id') . " AND post.intranet_id = " . $this->voucher->year->kernel->intranet->get('id'); |
|
54 | + $sql = "SELECT voucher.reference, post.id, post.text, post.voucher_id, post.date, post.account_id, post.debet, post.credit, post.stated, DATE_FORMAT(post.date, '%d-%m-%Y') AS date_dk FROM accounting_post post INNER JOIN accounting_voucher voucher ON post.voucher_id = voucher.id WHERE post.year_id = ".$this->voucher->year->get('id')." AND post.intranet_id = ".$this->voucher->year->kernel->intranet->get('id'); |
|
55 | 55 | if ($type == 'stated') { |
56 | 56 | $sql .= " AND post.stated = 1"; |
57 | 57 | } elseif ($type == 'draft') { |
58 | 58 | $sql .= " AND post.stated = 0"; |
59 | 59 | } |
60 | - $db->query($sql . " ORDER BY post.voucher_id DESC, post.id DESC"); |
|
60 | + $db->query($sql." ORDER BY post.voucher_id DESC, post.id DESC"); |
|
61 | 61 | |
62 | 62 | $i = 0; |
63 | 63 | $this->value['list_saldo'] = 0; |
@@ -16,11 +16,11 @@ discard block |
||
16 | 16 | if (empty($dbhost) OR empty($dbuser) OR empty($dbpass) OR empty($dbname)) { |
17 | 17 | $this->db = MDB2::singleton(DB_DSN); |
18 | 18 | } else { |
19 | - $this->db = MDB2::singleton('mysql://' . $dbuser . ':' . $dbpass . '@' . $dbhost . '/' . $dbname); |
|
19 | + $this->db = MDB2::singleton('mysql://'.$dbuser.':'.$dbpass.'@'.$dbhost.'/'.$dbname); |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | if (PEAR::isError($this->db)) { |
23 | - die($this->db->getMessage() . ' ' . $this->db->getUserInfo()); |
|
23 | + die($this->db->getMessage().' '.$this->db->getUserInfo()); |
|
24 | 24 | } |
25 | 25 | $this->db->query('SET NAMES utf8'); |
26 | 26 | $this->db->setOption('portability', MDB2_PORTABILITY_NONE); |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | { |
31 | 31 | $this->result = $this->db->query($SQL); |
32 | 32 | if (PEAR::isError($this->result)) { |
33 | - die($this->result->getMessage() . ' ' . $this->result->getUserInfo()); |
|
33 | + die($this->result->getMessage().' '.$this->result->getUserInfo()); |
|
34 | 34 | } |
35 | 35 | } |
36 | 36 | |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | { |
39 | 39 | $this->result = $this->db->exec($SQL); |
40 | 40 | if (PEAR::isError($this->result)) { |
41 | - die($this->result->getMessage() . ' ' . $this->result->getUserInfo()); |
|
41 | + die($this->result->getMessage().' '.$this->result->getUserInfo()); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | $this->result->free(); |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | // while($db->next_record()) { |
53 | 53 | $this->row = $this->result->fetchRow(MDB2_FETCHMODE_ASSOC); |
54 | 54 | if (PEAR::isError($this->row)) { |
55 | - die($this->row->getMessage() . '' . $this->row->getUserInfo()); |
|
55 | + die($this->row->getMessage().''.$this->row->getUserInfo()); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | return($this->row); |
@@ -373,7 +373,7 @@ |
||
373 | 373 | try { |
374 | 374 | $product->setAttributeGroup($group); |
375 | 375 | $this->assertTrue(false, 'An excpetion is not thrown'); |
376 | - } catch(Exception $e) { |
|
376 | + } catch (Exception $e) { |
|
377 | 377 | $this->assertEquals('You can not set attribute group for a product without variations!', $e->getMessage()); |
378 | 378 | } |
379 | 379 | } |
@@ -38,7 +38,7 @@ |
||
38 | 38 | |
39 | 39 | try { |
40 | 40 | $object->save(); |
41 | - } catch(Exception $e) { |
|
41 | + } catch (Exception $e) { |
|
42 | 42 | // $this->assertTrue(false, $e->getErrorMessage()); |
43 | 43 | } |
44 | 44 | } |