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


PHP Quota::Create方法代码示例

本文整理汇总了PHP中Quota::Create方法的典型用法代码示例。如果您正苦于以下问题:PHP Quota::Create方法的具体用法?PHP Quota::Create怎么用?PHP Quota::Create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Quota的用法示例。


在下文中一共展示了Quota::Create方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testAddsNewQuota

 public function testAddsNewQuota()
 {
     $duration = QuotaDuration::Month;
     $limit = 2.4;
     $unit = QuotaUnit::Reservations;
     $resourceId = 2183;
     $groupId = 123987;
     $scheduleId = 102983;
     $quota = Quota::Create($duration, $limit, $unit, $resourceId, $groupId, $scheduleId);
     $command = new AddQuotaCommand($duration, $limit, $unit, $resourceId, $groupId, $scheduleId);
     $this->repository->Add($quota);
     $this->assertEquals($command, $this->db->_LastCommand);
 }
开发者ID:utn-frm-si,项目名称:booked,代码行数:13,代码来源:QuotaRepositoryTests.php

示例2: AddQuota

 public function AddQuota()
 {
     Log::Debug('Adding new quota. Duration %s, Limit %s, Unit %s, Resource %s, Group %s, Schedule %s', $this->page->GetDuration(), $this->page->GetLimit(), $this->page->GetUnit(), $this->page->GetResourceId(), $this->page->GetGroupId(), $this->page->GetScheduleId());
     $quota = Quota::Create($this->page->GetDuration(), $this->page->GetLimit(), $this->page->GetUnit(), $this->page->GetResourceId(), $this->page->GetGroupId(), $this->page->GetScheduleId());
     $this->quotaRepository->Add($quota);
 }
开发者ID:hugutux,项目名称:booked,代码行数:6,代码来源:ManageQuotasPresenter.php

示例3: testWhenAdding

 public function testWhenAdding()
 {
     $duration = QuotaDuration::Day;
     $limit = 2;
     $unit = QuotaUnit::Hours;
     $resourceId = 987;
     $groupId = 8287;
     $scheduleId = 400;
     $this->page->expects($this->atLeastOnce())->method('GetDuration')->will($this->returnValue($duration));
     $this->page->expects($this->atLeastOnce())->method('GetLimit')->will($this->returnValue($limit));
     $this->page->expects($this->atLeastOnce())->method('GetUnit')->will($this->returnValue($unit));
     $this->page->expects($this->atLeastOnce())->method('GetResourceId')->will($this->returnValue($resourceId));
     $this->page->expects($this->atLeastOnce())->method('GetGroupId')->will($this->returnValue($groupId));
     $this->page->expects($this->atLeastOnce())->method('GetScheduleId')->will($this->returnValue($scheduleId));
     $expectedQuota = Quota::Create($duration, $limit, $unit, $resourceId, $groupId, $scheduleId);
     $this->quotaRepository->expects($this->once())->method('Add')->with($this->equalTo($expectedQuota));
     $this->presenter->AddQuota();
 }
开发者ID:utn-frm-si,项目名称:booked,代码行数:18,代码来源:ManageQuotasPresenterTests.php


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