/** * @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); }
/** * @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__); } }