24 public function testGetDbManager()
27 $this->assertInstanceOf(
'Fossology\Lib\Db\DbManager', $testDb->getDbManager());
30 public function testCreatePlainTables()
33 $testDb->createPlainTables(array(
'tag'));
34 $dbManager = $testDb->getDbManager();
36 $dbManager->queryOnce(
"insert into tag (tag_pk,tag,tag_desc) values (1,'hello','world')");
37 $tag1 = $dbManager->getSingleRow(
'select * from tag where tag_pk=1');
38 assertThat($tag1,hasKey(
'tag_desc'));
39 assertThat($tag1[
'tag_desc'],is(
'world'));
42 public function testInsertData()
45 $testDb->createPlainTables(array(
'perm_upload'));
46 $testDb->insertData(array(
'perm_upload'));
47 $tag1 = $testDb->getDbManager()->getSingleRow(
'select perm from perm_upload where perm_upload_pk=1');
48 assertThat($tag1,hasKey(
'perm'));
49 assertThat($tag1[
'perm'],is(10));