Esempio n. 1
0
 public function testGetBytesFreeUsed()
 {
     $stats = new Stats();
     $this->assertEquals('0 bytes', $stats->getBytesFree());
     $this->assertEquals(0, $stats->getBytesFreePercentage());
     $this->assertEquals(0, $stats->getBytesUsedPercentage());
     $stats->setBytes(10000);
     $stats->setLimitMaxbytes(200000);
     $this->assertEquals('186 Kb', $stats->getBytesFree());
     $this->assertEquals(95, $stats->getBytesFreePercentage());
     $this->assertEquals(5, $stats->getBytesUsedPercentage());
     $stats->setBytes(152000);
     $this->assertEquals('47 Kb', $stats->getBytesFree());
     $this->assertEquals(24, $stats->getBytesFreePercentage());
     $this->assertEquals(76, $stats->getBytesUsedPercentage());
     $stats->setBytes(196000);
     $this->assertEquals('4 Kb', $stats->getBytesFree());
     $this->assertEquals(2, $stats->getBytesFreePercentage());
     $this->assertEquals(98, $stats->getBytesUsedPercentage());
 }