本文整理汇总了PHP中Checkout::getPatronId方法的典型用法代码示例。如果您正苦于以下问题:PHP Checkout::getPatronId方法的具体用法?PHP Checkout::getPatronId怎么用?PHP Checkout::getPatronId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Checkout
的用法示例。
在下文中一共展示了Checkout::getPatronId方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetPatronId
function testGetPatronId()
{
$due_date = "2015-09-10";
$copy_id = 1;
$patron_id = 1;
$checkin_status = 1;
$test_checkout = new Checkout($due_date, $copy_id, $patron_id, $checkin_status);
$result = $test_checkout->getPatronId();
$this->assertEquals($patron_id, $result);
}
示例2: testGetPatronId
function testGetPatronId()
{
$patron_name = "Eduardo";
$patron_id = 1;
$test_patron = new Patron($patron_name, $patron_id);
$test_patron->save();
$copy_id = 1;
$due_date = "2015-01-01";
$checkout_status = false;
$test_checkout = new Checkout($patron_id, $copy_id, $due_date, $checkout_status);
$result = $test_checkout->getPatronId();
$this->assertEquals(1, $result);
}
示例3: Patron
function test_getPatronId()
{
// for now, feed a dummy copy_id just for testing
// later, we will need to use getNextCopy() in Book class
// to get a copy for a given book
//Arrange
// Make a Patron
$name = "Dan Brown";
$phone = "3";
$email = "a@a.com";
$test_patron = new Patron($name, $phone, $email);
// Make a Checkout
$patron_id = $test_patron->getId();
$copy_id = 1;
$date = "2015-08-09";
$test_checkout = new Checkout($patron_id, $copy_id, $date);
//Act
$result = $test_checkout->getPatronId();
//Assert
$this->assertEquals($patron_id, $result);
}
示例4: Patron
function test_updatePatronId()
{
//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();
//Make a second Patron
$name2 = "Vaughn Brown";
$phone2 = "4";
$email2 = "vaughn.brown@jla.com";
$test_patron2 = new Patron($name2, $phone2, $email2);
$test_patron2->save();
$new_patron_id = $test_patron2->getId();
//Act
$test_checkout->updatePatronId($new_patron_id);
//Assert
$result = $test_checkout->getPatronId();
$this->assertEquals($new_patron_id, $result);
}