Ejemplo n.º 1
0
 public function load(ObjectManager $manager)
 {
     $wh = new WorkHistory();
     $wh->setTeam($this->getReference('team-1'));
     $wh->setUser($this->getReference('user-1'));
     $wh->setStartSemester($this->getReference('semester-1'));
     $wh->setPosition($this->getReference('position-1'));
     $manager->persist($wh);
     $wh2 = new WorkHistory();
     $wh2->setTeam($this->getReference('team-2'));
     $wh2->setUser($this->getReference('user-2'));
     $wh2->setStartSemester($this->getReference('semester-1'));
     $wh2->setPosition($this->getReference('position-2'));
     $manager->persist($wh2);
     $wh3 = new WorkHistory();
     $wh3->setTeam($this->getReference('team-1'));
     $wh3->setUser($this->getReference('user-4'));
     $wh3->setStartSemester($this->getReference('semester-1'));
     $wh3->setEndSemester($this->getReference('semester-1'));
     $wh3->setPosition($this->getReference('position-2'));
     $manager->persist($wh3);
     $manager->flush();
     $this->addReference('wh-1', $wh);
     $this->addReference('wh-2', $wh2);
     $this->addReference('wh-3', $wh3);
 }
Ejemplo n.º 2
0
 public function testSetUser()
 {
     // new entity
     $wh = new WorkHistory();
     // dummy entity
     $user = new User();
     $user->setFirstName("Per");
     // Use the setUser method
     $wh->setUser($user);
     // Assert the result
     $this->assertEquals($user, $wh->getUser());
 }