How can I get started with PHPUnit, where my class construct requires a preconfigured db connection?
Posted
by Ben Dauphinee
on Stack Overflow
See other posts from Stack Overflow
or by Ben Dauphinee
Published on 2010-05-29T21:18:49Z
Indexed on
2010/05/29
21:22 UTC
Read the original article
Hit count: 267
I have a class that uses a lot of database internally, so I built the constructor with a $db handle that I am supposed to pass to it.
I am just getting started with PHPUnit, and I am not sure how I should go ahead and pass the database handle through setup.
public function setUp(/*do I pass a database handle through here, using a reference? aka &$db*/){
$this->_acl = new acl;
}
public function __construct(Zend_Db_Adapter_Abstract $db, $config = array()){
© Stack Overflow or respective owner