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

Test class ilSkillCategory. More...

+ Inheritance diagram for SkillCategoryTest:
+ Collaboration diagram for SkillCategoryTest:

Public Member Functions

 testProperties ()
 

Protected Member Functions

 setGlobalVariable (string $name, $value)
 
 setUp ()
 
 tearDown ()
 

Protected Attributes

ilSkillCategory $skill_category
 

Detailed Description

Test class ilSkillCategory.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 28 of file SkillCategoryTest.php.

Member Function Documentation

◆ setGlobalVariable()

SkillCategoryTest::setGlobalVariable ( string  $name,
  $value 
)
protected

Definition at line 32 of file SkillCategoryTest.php.

References $c, $DIC, $GLOBALS, and $name.

Referenced by setUp().

32  : void
33  {
34  global $DIC;
35 
36  $GLOBALS[$name] = $value;
37 
38  unset($DIC[$name]);
39  $DIC[$name] = static function (\ILIAS\DI\Container $c) use ($value) {
40  return $value;
41  };
42  }
$c
Definition: cli.php:38
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:31
global $DIC
Definition: feed.php:28
if($format !==null) $name
Definition: metadata.php:247
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
+ Here is the caller graph for this function:

◆ setUp()

SkillCategoryTest::setUp ( )
protected

Definition at line 45 of file SkillCategoryTest.php.

References $dic, $GLOBALS, and setGlobalVariable().

45  : void
46  {
47  parent::setUp();
48 
49  $dic = new ILIAS\DI\Container();
50  $GLOBALS['DIC'] = $dic;
51 
52  $db = $this->createMock(ilDBInterface::class);
53  $this->setGlobalVariable(
54  "ilDB",
55  $db
56  );
57  $tree = $this->createMock(ilTree::class);
58  $this->setGlobalVariable(
59  "tree",
60  $tree
61  );
62  $rbac = $this->createMock(ilRbacSystem::class);
63  $this->setGlobalVariable(
64  "rbacsystem",
65  $rbac
66  );
67  $user = $this->createMock(ilObjUser::class);
68  $this->setGlobalVariable(
69  "ilUser",
70  $user
71  );
72 
73  $this->skill_category = new ilSkillCategory();
74  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setGlobalVariable(string $name, $value)
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
$dic
Definition: result.php:32
+ Here is the call graph for this function:

◆ tearDown()

SkillCategoryTest::tearDown ( )
protected

Definition at line 76 of file SkillCategoryTest.php.

76  : void
77  {
78  }

◆ testProperties()

SkillCategoryTest::testProperties ( )

Definition at line 80 of file SkillCategoryTest.php.

References $skill_category, and ilSkillTreeNode\setTitle().

80  : void
81  {
83  $sk->setTitle("A skill category");
84  $sk->setDescription("This is a description for a skill category.");
85  $sk->setSelfEvaluation(true);
86  $sk->setOrderNr(10);
87  $sk->setStatus(0);
88  $sk->setId(4);
89  $sk->setImportId("an_import_id");
90 
91  $this->assertEquals(
92  "scat",
93  $sk->getType()
94  );
95  $this->assertEquals(
96  "A skill category",
97  $sk->getTitle()
98  );
99  $this->assertEquals(
100  "This is a description for a skill category.",
101  $sk->getDescription()
102  );
103  $this->assertEquals(
104  true,
105  $sk->getSelfEvaluation()
106  );
107  $this->assertEquals(
108  10,
109  $sk->getOrderNr()
110  );
111  $this->assertEquals(
112  0,
113  $sk->getStatus()
114  );
115  $this->assertEquals(
116  4,
117  $sk->getId()
118  );
119  $this->assertEquals(
120  "an_import_id",
121  $sk->getImportId()
122  );
123  }
setTitle(string $a_title)
ilSkillCategory $skill_category
+ Here is the call graph for this function:

Field Documentation

◆ $skill_category

ilSkillCategory SkillCategoryTest::$skill_category
protected

Definition at line 30 of file SkillCategoryTest.php.

Referenced by testProperties().


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