ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
assAnswerMatchingPairTest Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for assAnswerMatchingPairTest:
+ Collaboration diagram for assAnswerMatchingPairTest:

Public Member Functions

 testAnswerMatchingPairInstantiation ()
 
 testAnswerMatchingPairMutation ()
 

Protected Member Functions

 setUp ()
 
- Protected Member Functions inherited from assBaseTestCase
 setUp ()
 
 tearDown ()
 
 setGlobalVariable (string $name, $value)
 
 getGlobalTemplateMock ()
 
 getDatabaseMock ()
 
 getIliasMock ()
 

Protected Attributes

 $backupGlobals = false
 
- Protected Attributes inherited from assBaseTestCase
Container $dic = null
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Unit tests

Author
Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de

Definition at line 26 of file assAnswerMatchingPairTest.php.

Member Function Documentation

◆ setUp()

assAnswerMatchingPairTest::setUp ( )
protected

Definition at line 30 of file assAnswerMatchingPairTest.php.

30  : void
31  {
32  chdir(dirname(__FILE__));
33  chdir('../../../');
34  }

◆ testAnswerMatchingPairInstantiation()

assAnswerMatchingPairTest::testAnswerMatchingPairInstantiation ( )

Definition at line 36 of file assAnswerMatchingPairTest.php.

36  : void
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  }
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...

◆ testAnswerMatchingPairMutation()

assAnswerMatchingPairTest::testAnswerMatchingPairMutation ( )

Definition at line 44 of file assAnswerMatchingPairTest.php.

44  : 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  }
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...

Field Documentation

◆ $backupGlobals

assAnswerMatchingPairTest::$backupGlobals = false
protected

Definition at line 28 of file assAnswerMatchingPairTest.php.


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