You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
3.01-QCM_MuscuMaths/Website/tests/testClasses/testQuestion.php

30 lines
954 B

<?php
use PHPUnit\Framework\TestCase;
use classes\Question;
final class testQuestion extends TestCase
{
public function testInstanciation()
{
$question = new Question(1, "question", 1);
$this->assertInstanceOf(Question::class, $question);
$this->assertEquals(1, $question->getId());
$this->assertEquals("question", $question->getContent());
$this->assertEquals(1, $question->getIdChapter());
}
public function testSetter()
{
$question = new Question(1, "question", 1);
$question->setContent("new question");
$this->assertEquals("new question", $question->getContent());
$question->setDifficulty(2);
$this->assertEquals(2, $question->getDifficulty());
$question->setIdAnswerGood(2);
$this->assertEquals(2, $question->getIdAnswerGood());
$question->setNbFails(3);
$this->assertEquals(3, $question->getNbFails());
}
}