Esempio n. 1
0
 function testQuotas()
 {
     // Create account if doesnt exists yet
     $AccountManager = new AccountManager();
     $Account = $AccountManager->GetUserByName("cptest");
     if (!$Account) {
         $Account = $AccountManager->Create("cptest", "cptest", "webta.net");
     }
     $FileSystem = new FileSystem();
     $homemount = $FileSystem->GetHomeRootMount();
     $aquotapath = "{$homemount[1]}/aquota.user";
     //
     // Check either quotas exist
     //
     $this->assertTrue(file_exists($aquotapath) && filesize($aquotapath) > 0, "{$aquotapath} size is more than zero");
     //
     // Set quota
     //
     $QuotaManager = new QuotaManager($aid);
     $retval = $QuotaManager->SetQuota("cptest", 5, 5, 5, 5);
     $this->assertTrue($retval, "SetQuota returned true ({$retval})");
 }