fix bug in columnList(), add test

This commit is contained in:
Sergey Tsalkov
2021-08-08 14:15:19 +00:00
parent e30c240d54
commit 57b7527a46
2 changed files with 5 additions and 2 deletions

View File

@@ -486,7 +486,7 @@ class MeekroDB {
$columns[$row['Field']] = array( $columns[$row['Field']] = array(
'type' => $row['Type'], 'type' => $row['Type'],
'null' => $row['Null'], 'null' => $row['Null'],
'key' => $row['Type'], 'key' => $row['Key'],
'default' => $row['Default'], 'default' => $row['Default'],
'extra' => $row['Extra'] 'extra' => $row['Extra']
); );

View File

@@ -279,7 +279,10 @@ class BasicTest extends SimpleTest {
$columns = DB::columnList('store data'); $columns = DB::columnList('store data');
$this->assert(count($columns) === 2); $this->assert(count($columns) === 2);
$this->assert($columns['picture']['type'] === 'blob'); $this->assert($columns['picture']['type'] === 'blob');
$this->assert($columns['picture']['null'] === 'YES');
$this->assert($columns['picture']['key'] === '');
$this->assert($columns['picture']['default'] === NULL);
$this->assert($columns['picture']['extra'] === '');
$smile = file_get_contents(__DIR__ . '/smile1.jpg'); $smile = file_get_contents(__DIR__ . '/smile1.jpg');
DB::insert('store data', array( DB::insert('store data', array(