修改model类单元测试文件

This commit is contained in:
oldrind
2016-03-05 18:44:17 +08:00
parent 7dfce7029d
commit 743a34b10d

View File

@@ -586,37 +586,37 @@ EOF;
public function testDelete() public function testDelete()
{ {
// $config = $this->getConfig(); $config = $this->getConfig();
//
// $order_model = new Model('order', $config); $order_model = new Model('order', $config);
// $order_model->id = 2; $order_model->id = 2;
// $flag = $order_model->delete(); $flag = $order_model->delete();
// $this->assertEquals(1, $flag); $this->assertEquals(1, $flag);
//
// $flag = $order_model->delete('1'); $flag = $order_model->delete('1');
// $this->assertEquals(1, $flag); $this->assertEquals(1, $flag);
//
// $address_model = new Model('user_address', $config); $address_model = new Model('user_address', $config);
// $flag = $address_model->delete(['1', '2']); $flag = $address_model->delete(['1', '2']);
// $this->assertEquals(2, $flag); $this->assertEquals(2, $flag);
//
// $user_model = new Model('user', $config); $user_model = new Model('user', $config);
// $flag = $user_model->using([''])->where('1=1')->delete(); $flag = $user_model->using([''])->where('1=1')->delete();
// $this->assertEquals(2, $flag); $this->assertEquals(2, $flag);
//
// $ru_model = new Model('role_user', $config); $ru_model = new Model('role_user', $config);
// $flag = $ru_model->delete(['1', '1']); $flag = $ru_model->delete(['1', '1']);
// $this->assertEquals(1, $flag); $this->assertEquals(1, $flag);
//
// $sql = <<<EOF $sql = <<<EOF
//DROP TABLE IF EXISTS `tp_user`; DROP TABLE IF EXISTS `tp_user`;
//DROP TABLE IF EXISTS `tp_order`; DROP TABLE IF EXISTS `tp_order`;
//DROP TABLE IF EXISTS `tp_user_address`; DROP TABLE IF EXISTS `tp_user_address`;
//DROP TABLE IF EXISTS `tp_role_user`; DROP TABLE IF EXISTS `tp_role_user`;
//EOF; EOF;
// $model = new Model('', $this->getConfig()); $model = new Model('', $this->getConfig());
// $model->execute($sql); $model->execute($sql);
// $flag = $model->db(0, null); $flag = $model->db(0, null);
// $this->assertNull($flag); $this->assertNull($flag);
} }
} }