ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
EventItemsTest Class Reference

Test class ilEventItems. More...

+ Inheritance diagram for EventItemsTest:
+ Collaboration diagram for EventItemsTest:

Public Member Functions

 testSetEventId ()
 

Protected Member Functions

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

Protected Attributes

ilEventItems $event_items
 

Detailed Description

Test class ilEventItems.

Author
Thomas Famula famul.nosp@m.a@le.nosp@m.ifos..nosp@m.de

Definition at line 28 of file EventItemsTest.php.

Member Function Documentation

◆ setGlobalVariable()

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

Definition at line 32 of file EventItemsTest.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()

EventItemsTest::setUp ( )
protected

Definition at line 45 of file EventItemsTest.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  $tree = $this->createMock(ilTree::class);
54 
55  $this->setGlobalVariable(
56  "ilDB",
57  $db
58  );
59  $this->setGlobalVariable(
60  "tree",
61  $tree
62  );
63 
64  $this->event_items = new ilEventItems(4);
65  }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
setGlobalVariable(string $name, $value)
$dic
Definition: result.php:32
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ tearDown()

EventItemsTest::tearDown ( )
protected

Definition at line 67 of file EventItemsTest.php.

67  : void
68  {
69  }

◆ testSetEventId()

EventItemsTest::testSetEventId ( )

Definition at line 71 of file EventItemsTest.php.

References $event_items, and ilEventItems\setEventId().

71  : void
72  {
73  $ei = $this->event_items;
74  $ei->setEventId(7);
75 
76  $this->assertNotEquals(
77  4,
78  $ei->getEventId()
79  );
80  $this->assertEquals(
81  7,
82  $ei->getEventId()
83  );
84  }
setEventId(int $a_event_id)
ilEventItems $event_items
+ Here is the call graph for this function:

Field Documentation

◆ $event_items

ilEventItems EventItemsTest::$event_items
protected

Definition at line 30 of file EventItemsTest.php.

Referenced by testSetEventId().


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