Example #1
0
 public function testMoreAnswers()
 {
     $mockAnswer = $this->_mockContainer->getAnswer(1);
     $mockAnswer2 = $this->_mockContainer->getAnswer(2);
     $this->_question->addAnswer($mockAnswer);
     $this->_question->addAnswer($mockAnswer2);
     /** @var $answers \Pollex\Entity\Poll\Question\Answer */
     $answers = $this->_question->getAnswers();
     $this->assertTrue(2 == count($answers));
     foreach ($answers as $answer) {
         $this->assertInstanceOf('\\Pollex\\Entity\\Poll\\Question\\Answer', $answer);
     }
     $this->assertEquals(1, $answers[0]->getId());
     $this->assertEquals(2, $answers[1]->getId());
 }