本文整理汇总了PHP中Checkout::updateDueDate方法的典型用法代码示例。如果您正苦于以下问题:PHP Checkout::updateDueDate方法的具体用法?PHP Checkout::updateDueDate怎么用?PHP Checkout::updateDueDate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Checkout
的用法示例。
在下文中一共展示了Checkout::updateDueDate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Checkout
function test_updateDueDate()
{
//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();
//Act
$new_due_date = "2015-10-03";
$test_checkout->updateDueDate($new_due_date);
//Assert
$result = Checkout::getAll();
$this->assertEquals($new_due_date, $result[0]->getDueDate());
}
示例2: Checkout
function test_updateDueDate()
{
//Arrange
$due_date = "0001-01-01";
$copy_id = 1;
$patron_id = 2;
$test_checkout = new Checkout($due_date, $copy_id, $patron_id);
$test_checkout->save();
$new_due_date = "2015-11-11";
$test_checkout->updateDueDate($new_due_date);
//Act
$id = $test_checkout->getId();
$result = new Checkout($new_due_date, $copy_id, $patron_id, $id);
//Assert
$this->assertEquals(Checkout::findDueDate($id), $result);
}
示例3: Patron
function test_updateDueDate()
{
//Arrange
// Make a Patron
$name = "Dan Brown";
$phone = "3";
$email = "a@a.com";
$test_patron = new Patron($name, $phone, $email);
$test_patron->save();
// Make a Checkout and save
$patron_id = $test_patron->getId();
$copy_id = 1;
$due_date = "2015-08-09";
$test_checkout = new Checkout($patron_id, $copy_id, $due_date);
$test_checkout->save();
$new_due_date = "2015-08-27";
//Act
$test_checkout->updateDueDate($new_due_date);
//Assert
$result = $test_checkout->getDueDate();
$this->assertEquals($new_due_date, $result);
}