ILIAS  trunk Revision v11.0_alpha-1689-g66c127b4ae8
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilTestRandomQuestionCollectionSubsetApplicationTest Class Reference

Class ilTestRandomQuestionCollectionSubsetApplicationTest. More...

+ Inheritance diagram for ilTestRandomQuestionCollectionSubsetApplicationTest:
+ Collaboration diagram for ilTestRandomQuestionCollectionSubsetApplicationTest:

Public Member Functions

 test_instantiateObject_shouldReturnInstance ()
 
 testApplicantId ()
 
 testRequiredAmount ()
 
 testHasRequiredAmountLeft ()
 
 testDecrementRequiredAmount ()
 
 testHasQuestion ()
 
 testGetQuestion ()
 

Protected Member Functions

 setUp ()
 
- Protected Member Functions inherited from ilTestBaseTestCase
 setUp ()
 
 tearDown ()
 

Private Attributes

ilTestRandomQuestionCollectionSubsetApplication $testObj
 

Additional Inherited Members

- Static Public Member Functions inherited from ilTestBaseTestCase
static callMethod ($obj, $name, array $args=[])
 
- Protected Attributes inherited from ilTestBaseTestCase
Container $dic = null
 

Detailed Description

Member Function Documentation

◆ setUp()

ilTestRandomQuestionCollectionSubsetApplicationTest::setUp ( )
protected

◆ test_instantiateObject_shouldReturnInstance()

ilTestRandomQuestionCollectionSubsetApplicationTest::test_instantiateObject_shouldReturnInstance ( )

Definition at line 36 of file ilTestRandomQuestionCollectionSubsetApplicationTest.php.

36  : void
37  {
38  $this->assertInstanceOf(ilTestRandomQuestionCollectionSubsetApplication::class, $this->testObj);
39  }

◆ testApplicantId()

ilTestRandomQuestionCollectionSubsetApplicationTest::testApplicantId ( )

Definition at line 41 of file ilTestRandomQuestionCollectionSubsetApplicationTest.php.

41  : void
42  {
43  $applicantId = 12;
44  $this->testObj->setApplicantId($applicantId);
45  $this->assertEquals($applicantId, $this->testObj->getApplicantId());
46  }

◆ testDecrementRequiredAmount()

ilTestRandomQuestionCollectionSubsetApplicationTest::testDecrementRequiredAmount ( )

Definition at line 63 of file ilTestRandomQuestionCollectionSubsetApplicationTest.php.

63  : void
64  {
65  $requiredAmount = 5;
66  $this->testObj->setRequiredAmount($requiredAmount);
67  $this->testObj->decrementRequiredAmount();
68  $this->assertEquals(--$requiredAmount, $this->testObj->getRequiredAmount());
69  }

◆ testGetQuestion()

ilTestRandomQuestionCollectionSubsetApplicationTest::testGetQuestion ( )

Definition at line 83 of file ilTestRandomQuestionCollectionSubsetApplicationTest.php.

83  : void
84  {
85  $questionId = 2;
86  $question = new ilTestRandomQuestionSetQuestion();
87  $question->setQuestionId($questionId);
88  $this->testObj->addQuestion($question);
89 
90  $this->assertEquals($question, $this->testObj->getQuestion($questionId));
91  }

◆ testHasQuestion()

ilTestRandomQuestionCollectionSubsetApplicationTest::testHasQuestion ( )

Definition at line 71 of file ilTestRandomQuestionCollectionSubsetApplicationTest.php.

71  : void
72  {
73  $questionId = 2;
74  $this->assertFalse($this->testObj->hasQuestion($questionId));
75 
76  $question = new ilTestRandomQuestionSetQuestion();
77  $question->setQuestionId($questionId);
78 
79  $this->testObj->addQuestion($question);
80  $this->assertTrue($this->testObj->hasQuestion($questionId));
81  }

◆ testHasRequiredAmountLeft()

ilTestRandomQuestionCollectionSubsetApplicationTest::testHasRequiredAmountLeft ( )

Definition at line 55 of file ilTestRandomQuestionCollectionSubsetApplicationTest.php.

55  : void
56  {
57  for ($i = 3; $i > -3; $i--) {
58  $this->testObj->setRequiredAmount($i);
59  $this->assertEquals($i > 0, $this->testObj->hasRequiredAmountLeft());
60  }
61  }

◆ testRequiredAmount()

ilTestRandomQuestionCollectionSubsetApplicationTest::testRequiredAmount ( )

Definition at line 48 of file ilTestRandomQuestionCollectionSubsetApplicationTest.php.

48  : void
49  {
50  $requiredAmount = 12;
51  $this->testObj->setRequiredAmount($requiredAmount);
52  $this->assertEquals($requiredAmount, $this->testObj->getRequiredAmount());
53  }

Field Documentation

◆ $testObj

ilTestRandomQuestionCollectionSubsetApplication ilTestRandomQuestionCollectionSubsetApplicationTest::$testObj
private

The documentation for this class was generated from the following file: