本文整理汇总了PHP中UserModel::deleteAll方法的典型用法代码示例。如果您正苦于以下问题:PHP UserModel::deleteAll方法的具体用法?PHP UserModel::deleteAll怎么用?PHP UserModel::deleteAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserModel
的用法示例。
在下文中一共展示了UserModel::deleteAll方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setupBeforeClass
public static function setupBeforeClass()
{
// 下面四行代码模拟出一个应用实例, 每一行都很关键, 需正确设置参数
$app = new \Think\PhpunitHelper();
$app->setMVC('domain.com', 'Home', 'Index');
$app->setTestConfig(['DB_NAME' => 'mydb_test', 'DB_HOST' => 'localhost']);
// 一定要设置一个测试用的数据库,避免测试过程破坏生产数据
$app->start();
error_reporting(E_ERROR);
$userTable = new UserModel();
$userTable->deleteAll();
}
示例2: testDeleteAll
public function testDeleteAll()
{
$table = new UserModel();
$table->deleteAll();
$this->assertCount(0, $table->select());
}
示例3: testDeleteAll
public function testDeleteAll()
{
$userTable = new UserModel();
$letterTable = new LetterListModel();
$userTable->deleteAll();
$letter = $letterTable->find();
$user = $userTable->find();
$this->assertTrue($letter == null && $user == null);
}
示例4: testDeleteAll
public function testDeleteAll()
{
$userTable = new UserModel();
$commentTable = new CommentModel();
$moodTable = new MoodListModel();
$userTable->deleteAll();
$comment = $commentTable->find();
$mood = $moodTable->find();
$user = $userTable->find();
$this->assertTrue($comment == null && $user == null && $mood == null);
}
示例5: testDeleteAllUser
public function testDeleteAllUser()
{
$userTable = new UserModel();
$moodTable = new MoodListModel();
$userTable->deleteAll();
$this->assertTrue($moodTable->find() == NULL && $userTable->find() == NULL);
}
示例6: testDeleteAllUser
public function testDeleteAllUser()
{
$userTable = new UserModel();
$moodTable = new MoodListModel();
$praiseTable = new PraiseMoodModel();
$userTable->deleteAll();
$user = $userTable->find();
$mood = $moodTable->find();
$praise = $praiseTable->find();
$this->assertTrue($user === null && $mood === null && $praise === null);
}