Skip to content

Commit 180a574

Browse files
authored
Add listTable() tests
1 parent afc7f1a commit 180a574

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php namespace CodeIgniter\Database\Live;
2+
3+
use CodeIgniter\Test\CIDatabaseTestCase;
4+
5+
/**
6+
* @group DatabaseLive
7+
*/
8+
class MetadataTest extends CIDatabaseTestCase
9+
{
10+
protected $refresh = true;
11+
12+
protected $seed = 'Tests\Support\Database\Seeds\CITestSeeder';
13+
14+
public function testCanListTables()
15+
{
16+
$result = $this->db->listTables();
17+
18+
// user, job, misc, migrations
19+
$this->assertCount(4, $result);
20+
}
21+
22+
//--------------------------------------------------------------------
23+
24+
public function testCanListTablesConstrainPrefix()
25+
{
26+
$result = $this->db->listTables(true);
27+
28+
// user, job, misc, migrations
29+
$this->assertCount(4, $result);
30+
}
31+
32+
//--------------------------------------------------------------------
33+
34+
}

0 commit comments

Comments
 (0)