function activate_wpar_test() { RecordTest::install(); $r = new RecordTest(); $r->sometext = "hello"; $r->save(); $r->otherint = 123; $r->save(); $id = $r->id; $a = RecordTest::findOne($id); error_log("t: " . $a->sometext); $a = RecordTest::findOneByQuery("SELECT * FROM %t WHERE otherint=%s AND sometext=%s", 123, "hello"); error_log("found: " . $a->sometext); $a = RecordTest::findOneBy(array("otherint" => 123, "sometext" => "hello")); $r->delete(); $a = RecordTest::findOne(124123432); error_log("a: " . $a->sometext); }
function deactivate_wpar_test() { RecordTest::uninstall(); }
public static function setUpBeforeClass() { $config = (require '../config.php'); self::$connection = new MySql($config['Database']['MySql']); BaseRecord::setConnection(self::$connection); }