/** * @depends testIdentifyFakeEvaluate * @expectedException Exception **/ public function testIncompleteAndCrapEvaluations() { Qualifiers::add('QUAincomplete'); $places = ['v1' => 'p1', 'v2' => 'p1', 'v3' => 'p2', 'v4' => 'p2', 'v5' => 'p3']; $cvmp = Cvmp::buildCVmpByPlacements($places); $evals = @Qualifiers::getEvaluation($cvmp); $this->assertEquals(2, $evals['v1'], "Value !match"); unset($evals['v1']); foreach ($evals as $vm => $eval) { $this->assertEquals(1, $eval, "Value of '{$vm}' !match"); } }
public function testLoadClasses() { Qualifiers::add('QUAincomplete'); Cache::$cache->delete('load_test'); $places = ['v1' => 'p1', 'v2' => 'p1', 'v3' => 'p2', 'v4' => 'p2', 'v5' => 'p3']; $cvmp0 = Cvmp::buildCVmpByPlacements($places); $this->assertFalse(Cache::$cache->get('load_test')); $oc = new OrderCloud($cvmp0); $this->assertTrue(Cache::$cache->get('load_test')); }
/** * @depends testLastAdded * @depends testCvmpBuildCVmpByPlacements */ public function testComparisonCvmp() { $places = ['v1' => 'p1', 'v2' => 'p1', 'v3' => 'p2', 'v4' => 'p2', 'v5' => 'p3']; $cvmp1 = Cvmp::buildCVmpByPlacements($places); $cvmp2 = []; foreach ($places as $vm => $pm) { Cvmp::addVm($cvmp2, $vm, $pm); } unset($cvmp2[OC_LAST_ADD_VM]); unset($cvmp2[OC_LAST_ADD_PM]); $this->assertEquals($cvmp1, $cvmp2, "CVMP !match"); }