当前位置: 首页>>代码示例>>PHP>>正文


PHP Quota::ExceedsQuota方法代码示例

本文整理汇总了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);
 }
开发者ID:utn-frm-si,项目名称:booked,代码行数:15,代码来源:QuotaTests.php

示例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);
 }
开发者ID:utn-frm-si,项目名称:booked,代码行数:27,代码来源:QuotaWhenModifyingTests.php


注:本文中的Quota::ExceedsQuota方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。