/** * @test * * @group quota * @group small * @group dev */ public function test_getDefaultWebsiteQuotaSuccess() { // ARRANGE $expectedWebsiteMaxCount = 0; ConfigHelper::removeValue(array('quota')); // ACT $quota = new Quota(); $actualWebsiteQuota = $quota->getWebsiteQuota(); // ASSERT $actualWebsiteMaxCount = $actualWebsiteQuota->getMaxCount(); $this->assertEquals($expectedWebsiteMaxCount, $actualWebsiteMaxCount); }
/** * @throws /Cms/Exception */ public function checkWebsiteMaxCountQuota() { $count = $this->execute('getCount'); $quotas = new Quota(); $websiteQuota = $quotas->getWebsiteQuota(); if ($count >= $websiteQuota->getMaxCount()) { throw new CmsException(2300, __METHOD__, __LINE__); } }