Skip to content

Commit

Permalink
added test for singleton
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.php.net/repository/pear/packages/MDB/trunk@143682 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information
Lukas Smith committed Nov 3, 2003
1 parent db262dc commit 472b604
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/MDB_api_testcase.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,16 @@ function testNumCols() {
$this->assertTrue(!MDB::isError($numcols) && $numcols > 0);
$this->db->freeResult($result);
}

function testSingleton() {
$mdb =& MDB::singleton();
$this->assertTrue(MDB::isConnection($mdb));

// should have a different database name set
$mdb =& MDB::singleton($this->dsn, $this->options);

$this->assertTrue($mdb->db_index != $this->db->db_index);
}
}

?>

0 comments on commit 472b604

Please sign in to comment.