本文整理汇总了PHP中Checkout::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Checkout::delete方法的具体用法?PHP Checkout::delete怎么用?PHP Checkout::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Checkout
的用法示例。
在下文中一共展示了Checkout::delete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Checkout
function test_delete()
{
//Arrange
$checked_in_status = 0;
$due_date = "2000 BC";
$copy_id = 4;
$patron_id = 4;
$test_checkout = new Checkout($checked_in_status, $due_date, $copy_id, $patron_id);
$test_checkout->save();
//Act
$test_checkout->delete();
$result = Checkout::getAll();
//Assert
$this->assertEquals([], $result);
}
示例2: Checkout
function test_delete()
{
//Arrange
$copy_id = 1;
$patron_id = 4;
$due_date = "2015-09-03";
$test_checkout = new Checkout($copy_id, $patron_id, $due_date);
$test_checkout->save();
$copy_id2 = 2;
$patron_id2 = 1;
$due_date2 = "2015-10-05";
$test_checkout2 = new Checkout($copy_id2, $patron_id2, $due_date2);
$test_checkout2->save();
//Act
$test_checkout->delete();
//Assert
$result = Checkout::getAll();
$this->assertEquals([$test_checkout2], $result);
}