@@ -9,6 +9,9 @@ |
||
| 9 | 9 | public $kernel; |
| 10 | 10 | public $cmssite; |
| 11 | 11 | |
| 12 | + /** |
|
| 13 | + * @param Stub_Kernel $kernel |
|
| 14 | + */ |
|
| 12 | 15 | function __construct($kernel) |
| 13 | 16 | { |
| 14 | 17 | $this->kernel = $kernel; |
@@ -52,6 +52,9 @@ |
||
| 52 | 52 | } |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | + /** |
|
| 56 | + * @param string $post |
|
| 57 | + */ |
|
| 55 | 58 | function createPost($post) |
| 56 | 59 | { |
| 57 | 60 | $result = $this->db->exec('INSERT INTO ' . $this->table . ' (name) VALUES ('.$this->db->quote($post, 'text').')'); |
@@ -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++; |
@@ -4,6 +4,9 @@ |
||
| 4 | 4 | private $id = 1; |
| 5 | 5 | public $kernel; |
| 6 | 6 | |
| 7 | + /** |
|
| 8 | + * @param FakeContactKernel $kernel |
|
| 9 | + */ |
|
| 7 | 10 | function __construct($kernel) |
| 8 | 11 | { |
| 9 | 12 | $this->kernel = $kernel; |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | |
| 43 | 43 | function useShared($shared) |
| 44 | 44 | { |
| 45 | - switch($shared) { |
|
| 45 | + switch ($shared) { |
|
| 46 | 46 | case 'email': |
| 47 | 47 | require_once 'Intraface/shared/email/Email.php'; |
| 48 | 48 | break; |
@@ -63,6 +63,10 @@ discard block |
||
| 63 | 63 | class FakeDebtorSetting |
| 64 | 64 | { |
| 65 | 65 | |
| 66 | + /** |
|
| 67 | + * @param string $type |
|
| 68 | + * @param string $setting |
|
| 69 | + */ |
|
| 66 | 70 | function get($type, $setting) |
| 67 | 71 | { |
| 68 | 72 | |
@@ -145,6 +149,9 @@ discard block |
||
| 145 | 149 | |
| 146 | 150 | } |
| 147 | 151 | |
| 152 | + /** |
|
| 153 | + * @param Invoice $debtor |
|
| 154 | + */ |
|
| 148 | 155 | function createPayment($debtor) |
| 149 | 156 | { |
| 150 | 157 | $payment = new Payment($debtor); |
@@ -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 { |
@@ -1,4 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | +/** |
|
| 3 | + * @param string $f |
|
| 4 | + */ |
|
| 2 | 5 | function fht_deltree($f) |
| 3 | 6 | { |
| 4 | 7 | |
@@ -16,6 +19,9 @@ discard block |
||
| 16 | 19 | } |
| 17 | 20 | |
| 18 | 21 | |
| 22 | +/** |
|
| 23 | + * @param string $f |
|
| 24 | + */ |
|
| 19 | 25 | function iht_deltree($f) |
| 20 | 26 | { |
| 21 | 27 | |
@@ -7,10 +7,10 @@ discard block |
||
| 7 | 7 | if (!strcmp($item, '.') || !strcmp($item, '..')) { |
| 8 | 8 | continue; |
| 9 | 9 | } |
| 10 | - fht_deltree($f . "/" . $item); |
|
| 10 | + fht_deltree($f."/".$item); |
|
| 11 | 11 | } |
| 12 | 12 | rmdir($f); |
| 13 | - } else{ |
|
| 13 | + } else { |
|
| 14 | 14 | @unlink($f); |
| 15 | 15 | } |
| 16 | 16 | } |
@@ -24,10 +24,10 @@ discard block |
||
| 24 | 24 | if (!strcmp($item, '.') || !strcmp($item, '..')) { |
| 25 | 25 | continue; |
| 26 | 26 | } |
| 27 | - iht_deltree($f . "/" . $item); |
|
| 27 | + iht_deltree($f."/".$item); |
|
| 28 | 28 | } |
| 29 | 29 | rmdir($f); |
| 30 | - } else{ |
|
| 30 | + } else { |
|
| 31 | 31 | @unlink($f); |
| 32 | 32 | } |
| 33 | 33 | } |
@@ -29,6 +29,9 @@ |
||
| 29 | 29 | return new FileHandler($this->createKernel()); |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | + /** |
|
| 33 | + * @param string $file |
|
| 34 | + */ |
|
| 32 | 35 | function createFile($file) |
| 33 | 36 | { |
| 34 | 37 | $data = array('file_name' => $file); |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | { |
| 34 | 34 | $data = array('file_name' => $file); |
| 35 | 35 | $filehandler = $this->createFileHandler(); |
| 36 | - copy(dirname(__FILE__) . '/'.$file, PATH_UPLOAD.$file); |
|
| 36 | + copy(dirname(__FILE__).'/'.$file, PATH_UPLOAD.$file); |
|
| 37 | 37 | $filehandler->save(PATH_UPLOAD.$file, $file); |
| 38 | 38 | $filehandler->load(); |
| 39 | 39 | $this->assertEquals('', $filehandler->error->view()); |
@@ -36,6 +36,9 @@ discard block |
||
| 36 | 36 | return new Intraface_modules_product_ProductDoctrine; |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | + /** |
|
| 40 | + * @param string $name |
|
| 41 | + */ |
|
| 39 | 42 | function createProduct($name) |
| 40 | 43 | { |
| 41 | 44 | $product = $this->createProductObject(); |
@@ -49,6 +52,10 @@ discard block |
||
| 49 | 52 | return $product; |
| 50 | 53 | } |
| 51 | 54 | |
| 55 | + /** |
|
| 56 | + * @param string $group_name |
|
| 57 | + * @param string[] $attributes |
|
| 58 | + */ |
|
| 52 | 59 | public function createAttribute($group_name, $attributes) |
| 53 | 60 | { |
| 54 | 61 | $group = new Intraface_modules_product_Attribute_Group; |
@@ -6,6 +6,9 @@ |
||
| 6 | 6 | |
| 7 | 7 | private $groups; |
| 8 | 8 | |
| 9 | + /** |
|
| 10 | + * @param integer $groups |
|
| 11 | + */ |
|
| 9 | 12 | public function __construct($groups) |
| 10 | 13 | { |
| 11 | 14 | $this->groups = $groups; |
@@ -82,6 +82,9 @@ |
||
| 82 | 82 | return $this->context->getKernel(); |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | + /** |
|
| 86 | + * @return integer |
|
| 87 | + */ |
|
| 85 | 88 | function getShopId() |
| 86 | 89 | { |
| 87 | 90 | if ($this->query('shop_id')) { |