예제 #1
0
파일: QuotaTest.php 프로젝트: rukzuk/rukzuk
 /**
  * @test
  *
  * @group quota
  * @group small
  * @group dev
  */
 public function test_getDefaultWebhostingQuotaSuccess()
 {
     // ARRANGE
     $expectedWebhostingMaxCount = 0;
     ConfigHelper::removeValue(array('quota'));
     // ACT
     $quota = new Quota();
     $actualWebhostingQuota = $quota->getWebhostingQuota();
     // ASSERT
     $actualWebhostingMaxCount = $actualWebhostingQuota->getMaxCount();
     $this->assertEquals($expectedWebhostingMaxCount, $actualWebhostingMaxCount);
 }
예제 #2
0
파일: Website.php 프로젝트: rukzuk/rukzuk
 /**
  * @param array   $attributes
  * @param string  $websiteId
  * @throws /Cms/Exception
  */
 protected function checkWebhostingMaxCountQuota(array $attributes, $websiteId = null)
 {
     if (!array_key_exists('publishingenabled', $attributes)) {
         return;
     }
     if (!$attributes['publishingenabled']) {
         return;
     }
     $quotas = new Quota();
     $webhostingQuota = $quotas->getWebhostingQuota();
     if ($this->getNewPublishingEnabledCount($websiteId) > $webhostingQuota->getMaxCount()) {
         throw new CmsException(2303, __METHOD__, __LINE__);
     }
 }