ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator 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 27 of file EventItemsTest.php.

Member Function Documentation

◆ setGlobalVariable()

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

Definition at line 31 of file EventItemsTest.php.

References $c, $DIC, and $GLOBALS.

Referenced by setUp().

31  : void
32  {
33  global $DIC;
34 
35  $GLOBALS[$name] = $value;
36 
37  unset($DIC[$name]);
38  $DIC[$name] = static function (\ILIAS\DI\Container $c) use ($value) {
39  return $value;
40  };
41  }
$c
Definition: deliver.php:25
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:35
$GLOBALS["DIC"]
Definition: wac.php:53
global $DIC
Definition: shib_login.php:22
+ Here is the caller graph for this function:

◆ setUp()

EventItemsTest::setUp ( )
protected

Definition at line 44 of file EventItemsTest.php.

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

44  : void
45  {
46  parent::setUp();
47 
48  $dic = new ILIAS\DI\Container();
49  $GLOBALS['DIC'] = $dic;
50 
51  $db = $this->createMock(ilDBInterface::class);
52  $tree = $this->createMock(ilTree::class);
53 
54  $this->setGlobalVariable(
55  "ilDB",
56  $db
57  );
58  $this->setGlobalVariable(
59  "tree",
60  $tree
61  );
62 
63  $this->event_items = new ilEventItems(4);
64  }
$GLOBALS["DIC"]
Definition: wac.php:53
setGlobalVariable(string $name, $value)
$dic
Definition: result.php:31
class ilEventItems
+ Here is the call graph for this function:

◆ tearDown()

EventItemsTest::tearDown ( )
protected

Definition at line 66 of file EventItemsTest.php.

66  : void
67  {
68  }

◆ testSetEventId()

EventItemsTest::testSetEventId ( )

Definition at line 70 of file EventItemsTest.php.

References $event_items, and ilEventItems\setEventId().

70  : void
71  {
72  $ei = $this->event_items;
73  $ei->setEventId(7);
74 
75  $this->assertNotEquals(
76  4,
77  $ei->getEventId()
78  );
79  $this->assertEquals(
80  7,
81  $ei->getEventId()
82  );
83  }
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 29 of file EventItemsTest.php.

Referenced by testSetEventId().


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