function setUp() { $this->db = Database::init('sqlite', Model::$sqliteCfg); $this->db->execDDL("create table user (id integer primary key autoincrement, name text not null default '', dob datetime)"); $this->db->execDDL("create table balance (id integer primary key autoincrement, user_id integer, amount integer, FOREIGN KEY (user_id) REFERENCES user(id))"); }
/** * @expectedException \InvalidArgumentException */ function testUnsupportedDatabase() { Database::init('oracle', []); }
function setUp() { $this->db = Database::init('mysql', Model::$mysqlCfg); $this->db->execDDL("create table user (id int primary key auto_increment, name varchar(50) not null default '', dob datetime)"); $this->db->execDDL("create table balance (id int primary key auto_increment, user_id int not null, amount int default 0, FOREIGN KEY (user_id) REFERENCES user(id))"); }