/** * Test allocated memory get method */ public function testGetAllocatedMemory() { $hardwareServer = new HardwareServerEntity(); $vs1 = new VirtualServerEntity(); $vs1->setMemory(1500); $vs2 = new VirtualServerEntity(); $vs2->setMemory(3000); $vs3 = new VirtualServerEntity(); $vs3->setMemory(12000); $hardwareServer->setVirtualServers([$vs1, $vs2, $vs3]); $this->assertNotEmpty($hardwareServer->getAllocatedMemory()); $this->assertEquals(1500 + 3000 + 12000, $hardwareServer->getAllocatedMemory()); }