ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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.

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 }
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:36
$c
Definition: deliver.php:25
global $DIC
Definition: shib_login.php:26
$GLOBALS["DIC"]
Definition: wac.php:54

References $c, $DIC, and $GLOBALS.

Referenced by setUp().

+ Here is the caller graph for this function:

◆ setUp()

EventItemsTest::setUp ( )
protected

Definition at line 44 of file EventItemsTest.php.

44 : void
45 {
46 parent::setUp();
47
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 }
setGlobalVariable(string $name, $value)
class ilEventItems
$dic
Definition: ltiresult.php:33

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

+ 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.

70 : void
71 {
73 $ei->setEventId(7);
74
75 $this->assertNotEquals(
76 4,
77 $ei->getEventId()
78 );
79 $this->assertEquals(
80 7,
81 $ei->getEventId()
82 );
83 }
ilEventItems $event_items
setEventId(int $a_event_id)

References $event_items, and ilEventItems\setEventId().

+ 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: