Ejemplo n.º 1
0
 public function testCombinedName()
 {
     $campaign = new Campaign();
     $campaign->setName('test name');
     $campaign->setCode('test_code');
     $campaign->prePersist();
     $this->assertEquals('test name (test_code)', $campaign->getCombinedName());
     $campaign->setCode('new_code');
     $campaign->preUpdate();
     $this->assertEquals('test name (new_code)', $campaign->getCombinedName());
 }
Ejemplo n.º 2
0
 protected function createCampaign(array $data, $user)
 {
     $campaign = new Campaign();
     $campaign->setName($data['Name']);
     $campaign->setCode($data['Code']);
     $campaign->setBudget($data['Budget']);
     $campaign->setOwner($user);
     $campaign->setOrganization($this->organization);
     return $campaign;
 }