本文整理汇总了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);
}
示例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);
}
示例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();
}