ILIAS  release_8 Revision v8.25
assAnswerMatchingPairTest.php
Go to the documentation of this file.
1<?php
2
27{
28 protected $backupGlobals = false;
29
30 protected function setUp(): void
31 {
32 chdir(dirname(__FILE__));
33 chdir('../../../');
34 }
35
37 {
38 $term = new assAnswerMatchingTerm('test');
39 $definition = new assAnswerMatchingDefinition('testing');
40 $instance = new assAnswerMatchingPair($term, $definition, 0.0);
41 $this->assertInstanceOf('assAnswerMatchingPair', $instance);
42 }
43
44 public function testAnswerMatchingPairMutation(): void
45 {
46 $term = new assAnswerMatchingTerm('Term');
47 $definition = new assAnswerMatchingDefinition('Definition');
48 $instance = new assAnswerMatchingPair($term, $definition, 2.1);
49
50 $this->assertEquals('Term', $instance->getTerm()->getText());
51 $this->assertEquals('Definition', $instance->getDefinition()->getText());
52 $this->assertEquals(2.1, $instance->getPoints());
53
54 $term = new assAnswerMatchingTerm('another Term');
55 $definition = new assAnswerMatchingDefinition('another Definition');
56 $instance = $instance
57 ->withTerm($term)
58 ->withDefinition($definition)
59 ->withPoints(3.4);
60
61 $this->assertEquals('another Term', $instance->getTerm()->getText());
62 $this->assertEquals('another Definition', $instance->getDefinition()->getText());
63 $this->assertEquals(3.4, $instance->getPoints());
64 }
65}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class assBaseTestCase.