/** * @param \_OurBrand_\Quiz\Domain\Model\Exercises\SpellingAndGrammarCommaQuestion $question */ public function addQuestion($question) { $question->setExercise($this); $question->setNumber(count($this->questions)); $this->questions->add($question); $this->maxScore = count($this->questions); }
public function testGetExercise() { $sng = new SpellingAndGrammarCommaQuestion(); $exercise = new Exercise(); $this->assertNull($sng->setExercise($exercise)); $this->assertSame($exercise, $sng->getExercise()); }