ILIAS  trunk Revision v11.0_alpha-1713-gd8962da2f67
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
PollBlockTest Class Reference

Test class ilPollBlock. More...

+ Inheritance diagram for PollBlockTest:
+ Collaboration diagram for PollBlockTest:

Public Member Functions

 testSetTitle ()
 

Protected Member Functions

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

Protected Attributes

ilPollBlock $poll_block
 

Detailed Description

Test class ilPollBlock.

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

Definition at line 27 of file PollBlockTest.php.

Member Function Documentation

◆ setGlobalVariable()

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

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

PollBlockTest::setUp ( )
protected

Definition at line 44 of file PollBlockTest.php.

References $dic, $GLOBALS, $lng, 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  $lng = $this->createMock(ilLanguage::class);
53 
54  $this->setGlobalVariable(
55  "ilDB",
56  $db
57  );
58  $this->setGlobalVariable(
59  "lng",
60  $lng
61  );
62 
63  $this->poll_block = new ilPollBlock();
64  }
$GLOBALS["DIC"]
Definition: wac.php:53
setGlobalVariable(string $name, $value)
Custom block for polls.
global $lng
Definition: privfeed.php:31
$dic
Definition: result.php:31
+ Here is the call graph for this function:

◆ tearDown()

PollBlockTest::tearDown ( )
protected

Definition at line 66 of file PollBlockTest.php.

66  : void
67  {
68  }

◆ testSetTitle()

PollBlockTest::testSetTitle ( )

Definition at line 70 of file PollBlockTest.php.

References $poll_block, and ilCustomBlock\setTitle().

70  : void
71  {
72  $pb = $this->poll_block;
73  $pb->setTitle("A poll block");
74 
75  $this->assertEquals(
76  "A poll block",
77  $pb->getTitle()
78  );
79  }
setTitle(string $a_title)
ilPollBlock $poll_block
+ Here is the call graph for this function:

Field Documentation

◆ $poll_block

ilPollBlock PollBlockTest::$poll_block
protected

Definition at line 29 of file PollBlockTest.php.

Referenced by testSetTitle().


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