30 protected function setUp(): void
34 $ilCtrl_mock = $this->getMockBuilder(ilCtrl::class)
35 ->disableOriginalConstructor()
37 $ilCtrl_mock->method(
'saveParameter');
38 $ilCtrl_mock->method(
'saveParameterByClass');
39 $this->setGlobalVariable(
'ilCtrl', $ilCtrl_mock);
41 $lng_mock = $this->getMockBuilder(ilLanguage::class)
42 ->disableOriginalConstructor()
43 ->onlyMethods([
'txt'])
45 $lng_mock->method(
'txt')->will($this->returnValue(
'Test'));
46 $this->setGlobalVariable(
'lng', $lng_mock);
48 $this->setGlobalVariable(
'ilias', $this->getIliasMock());
49 $this->setGlobalVariable(
'ilDB', $this->getDatabaseMock());
56 $this->assertInstanceOf(assOrderingQuestion::class, $instance);
63 $this->assertInstanceOf(ilAssOrderingElementList::class, $list);
64 $this->assertEquals($question_id, $list->getQuestionId());
65 $this->assertEquals([], $list->getElements());
75 $this->assertNotEquals($original, $list->
withElements([]));
82 $this->assertInstanceOf(ilAssOrderingElement::class, $element);
83 $this->assertEquals($element_id, $element->getId());
96 $this->assertNotEquals($original, $element);
100 $this->assertNotEquals($original, $element);
101 $this->assertEquals($val, $element->getSolutionIdentifier());
103 $element = $original->withPosition($val);
104 $this->assertNotEquals($original, $element);
105 $this->assertEquals($val, $element->getPosition());
107 $element = $original->withIndentation($val);
108 $this->assertNotEquals($original, $element);
109 $this->assertEquals($val, $element->getIndentation());
111 $val =
'some string';
112 $element = $original->withContent($val);
113 $this->assertNotEquals($original, $element);
114 $this->assertEquals($val, $element->getContent());
testOrderingElementListDefaults()
withElements(array $elements)
withSolutionIdentifier(int $id)
withRandomIdentifier(int $id)
testOrderingElementListMutation(ilAssOrderingElementList $list)
testOrderingElementListDefaults
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
test_instantiateObject_shouldReturnInstance()
Class for ordering questions.
testOrderingElementDefaults()
testOrderingElementMutation(ilAssOrderingElement $element)
testOrderingElementDefaults