public function testSave() { $user = new User('email'); $this->em->persist($user); $this->em->flush(); $userToken = new UserToken($user, 'test_action', 'test_token'); $this->assertAttributeEquals('test_action', 'action', $userToken); $this->assertAttributeEquals('test_token', 'token', $userToken); $this->assertAttributeEquals($user, 'user', $userToken); $this->em->persist($userToken); $this->em->flush(); $this->em->clear(); $tokens = $this->repository->findAll(); $this->assertEquals(1, sizeof($tokens)); $token = $this->repository->find(array('user' => $user->getId(), 'action' => 'test_action', 'token' => 'test_token')); $this->assertNotNull($token); }
/** * Find package * * @param int $id * @return Newscoop\Package\Package */ public function find($id) { return $this->repository->find($id); }
/** * {@inheritdoc} */ public function value($key) { return $this->repository->find($key); }