13 public function testGetDbManager()
16 $this->assertInstanceOf(
'Fossology\Lib\Db\DbManager', $testDb->getDbManager());
19 public function testCreatePlainTables()
22 $testDb->createPlainTables(array(
'tag'));
23 $dbManager = $testDb->getDbManager();
25 $dbManager->queryOnce(
"insert into tag (tag_pk,tag,tag_desc) values (1,'hello','world')");
26 $tag1 = $dbManager->getSingleRow(
'select * from tag where tag_pk=1');
27 assertThat($tag1,hasKey(
'tag_desc'));
28 assertThat($tag1[
'tag_desc'],is(
'world'));
31 public function testInsertData()
34 $testDb->createPlainTables(array(
'perm_upload'));
35 $testDb->insertData(array(
'perm_upload'));
36 $tag1 = $testDb->getDbManager()->getSingleRow(
'select perm from perm_upload where perm_upload_pk=1');
37 assertThat($tag1,hasKey(
'perm'));
38 assertThat($tag1[
'perm'],is(10));