question = 1; $vote->score = 1; $vote->createdBy = new NullAccount(1); $vote->createdFor = 2; $id = QAQuestionVoteMapper::create()->execute($vote); self::assertGreaterThan(0, $vote->id); self::assertEquals($id, $vote->id); $voteR = QAQuestionVoteMapper::get()->where('id', $vote->id)->execute(); self::assertEquals($vote->question, $voteR->question); self::assertEquals($vote->score, $voteR->score); self::assertEquals(1, QAQuestionVoteMapper::get() ->where('question', 1) ->where('createdBy', 1) ->limit(1) ->execute()->id ); } }