/** * @param User $user * @param Status $status * @param bool $updateCurrentStatus */ protected function onSuccess(User $user, Status $status, $updateCurrentStatus) { $status->setUser($user); $this->em->persist($status); if ($updateCurrentStatus) { $user->setCurrentStatus($status); $this->um->updateUser($user); $this->um->reloadUser($user); } $this->em->flush(); }
public function testUser() { $this->assertNull($this->status->getUser()); $this->status->setUser($this->user); $this->assertEquals($this->user, $this->status->getUser()); }