本文整理汇总了PHP中Quota::ExceedsQuota方法的典型用法代码示例。如果您正苦于以下问题:PHP Quota::ExceedsQuota方法的具体用法?PHP Quota::ExceedsQuota怎么用?PHP Quota::ExceedsQuota使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Quota
的用法示例。
在下文中一共展示了Quota::ExceedsQuota方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testWhenHourlyLimitIsExceededInYear
public function testWhenHourlyLimitIsExceededInYear()
{
$duration = new QuotaDurationYear();
$limit = new QuotaLimitHours(1.5);
$startDate = Date::Parse('2011-04-03 0:30', $this->schedule->GetTimezone());
$endDate = Date::Parse('2011-04-03 1:30', $this->schedule->GetTimezone());
$series = $this->GetHourLongReservation($startDate, $endDate);
$quota = new Quota(1, $duration, $limit, $series->ResourceId());
$res1 = new ReservationItemView('ref1', $startDate->SetTimeString('00:00'), $endDate->SetTimeString('00:31'), '', $series->ResourceId(), 98712);
$res1->ScheduleId = $series->ScheduleId();
$reservations = array($res1);
$this->SearchReturns($reservations);
$exceeds = $quota->ExceedsQuota($series, $this->user, $this->schedule, $this->reservationViewRepository);
$this->assertTrue($exceeds);
}
示例2: testWhenDeletingAnInstanceItDoesNotCount
public function testWhenDeletingAnInstanceItDoesNotCount()
{
$ref1 = 'ref1';
$ref2 = 'ref2';
$ref3 = 'ref3';
$duration = new QuotaDurationDay();
$limit = new QuotaLimitCount(1);
$quota = new Quota(1, $duration, $limit);
$r1start = Date::Parse('2011-04-03 1:30', $this->tz);
$r1End = Date::Parse('2011-04-03 2:30', $this->tz);
$r2start = Date::Parse('2011-04-04 1:30', $this->tz);
$r2End = Date::Parse('2011-04-04 2:30', $this->tz);
$existing1 = new TestReservation($ref1, new DateRange($r1start, $r1End), 1);
$deleted = new TestReservation($ref2, new DateRange($r2start, $r2End), 2);
$new = new TestReservation($ref3, new DateRange($r2start, $r2End), 3);
$builder = new ExistingReservationSeriesBuilder();
$builder->WithCurrentInstance($existing1)->WithInstance($deleted)->WithInstance($new);
$series = $builder->BuildTestVersion();
$series->RemoveInstance($deleted);
$res1 = new ReservationItemView($ref1, $r1start, $r1End, '', $series->ResourceId(), $existing1->ReservationId());
$res2 = new ReservationItemView($ref2, $r1start, $r1End, '', $series->ResourceId(), $deleted->ReservationId());
$res3 = new ReservationItemView($ref3, $r2start, $r2End, '', $series->ResourceId(), $new->ReservationId());
$reservations = array($res1, $res2, $res3);
$this->SearchReturns($reservations);
$exceeds = $quota->ExceedsQuota($series, $this->user, $this->schedule, $this->reservationViewRepository);
$this->assertFalse($exceeds);
}