public function setUp() { $subclassMock1 = $this->getMock('Wealthbot\\AdminBundle\\Entity\\Subclass', array('getId')); $subclassMock1->expects($this->any())->method('getId')->will($this->returnValue(1)); $subclassMock1->setName('Subclass1'); $subclassMock1->setExpectedPerformance(0.5); $subclassMock2 = $this->getMock('Wealthbot\\AdminBundle\\Entity\\Subclass', array('getId')); $subclassMock2->expects($this->any())->method('getId')->will($this->returnValue(2)); $subclassMock2->setName('Subclass2'); $subclassMock2->setExpectedPerformance(0.7); $entity1 = new CeModelEntity(); $security1 = new Security(); $security1->setExpenseRatio(0.6); $securityAssignment1 = new SecurityAssignment(); $securityAssignment1->setSecurity($security1); $securityAssignment1->setSubclass($subclassMock1); $entity1->setSubclass($subclassMock1); $entity1->setPercent(40); $entity1->setSecurityAssignment($securityAssignment1); $entity2 = new CeModelEntity(); $security2 = new Security(); $security2->setExpenseRatio(0.3); $securityAssignment2 = new SecurityAssignment(); $securityAssignment2->setSecurity($security2); $securityAssignment2->setSubclass($subclassMock2); $entity2->setSubclass($subclassMock2); $entity2->setPercent(60); $entity2->setSecurityAssignment($securityAssignment2); $entity3 = new CeModelEntity(); $security3 = new Security(); $security3->setExpenseRatio(0.7); $securityAssignment3 = new SecurityAssignment(); $securityAssignment3->setSecurity($security3); $securityAssignment3->setSubclass($subclassMock1); $entity3->setSubclass($subclassMock1); $entity3->setPercent(100); $entity3->setSecurityAssignment($securityAssignment3); $entity3->setIsQualified(true); $model = new CeModel('Model'); $model->addModelEntity($entity1); $model->addModelEntity($entity2); $model->addModelEntity($entity3); $model->setLowMarketReturn(0.6); $model->setGenerousMarketReturn(1.3); $model->setForecast(0); $this->portfolioInformation = new PortfolioInformation(); $this->portfolioInformation->setModel($model); }
/** * Set securityAssignment * * @param \Wealthbot\AdminBundle\Entity\SecurityAssignment $securityAssignment * @return CeModelEntity */ public function setSecurityAssignment(\Wealthbot\AdminBundle\Entity\SecurityAssignment $securityAssignment = null) { parent::setSecurityAssignment($securityAssignment); return $this; }