本文整理匯總了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);
}