ILIAS  release_8 Revision v8.24
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 28 of file PollBlockTest.php.

Member Function Documentation

◆ setGlobalVariable()

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

Definition at line 32 of file PollBlockTest.php.

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 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:32
$c
Definition: cli.php:38
global $DIC
Definition: feed.php:28
if($format !==null) $name
Definition: metadata.php:247

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

Referenced by setUp().

+ Here is the caller graph for this function:

◆ setUp()

PollBlockTest::setUp ( )
protected

Definition at line 45 of file PollBlockTest.php.

45 : void
46 {
47 parent::setUp();
48
50 $GLOBALS['DIC'] = $dic;
51
52 $db = $this->createMock(ilDBInterface::class);
53 $lng = $this->createMock(ilLanguage::class);
54
55 $this->setGlobalVariable(
56 "ilDB",
57 $db
58 );
59 $this->setGlobalVariable(
60 "lng",
61 $lng
62 );
63
64 $this->poll_block = new ilPollBlock();
65 }
setGlobalVariable(string $name, $value)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$dic
Definition: result.php:32
$lng

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

+ Here is the call graph for this function:

◆ tearDown()

PollBlockTest::tearDown ( )
protected

Definition at line 67 of file PollBlockTest.php.

67 : void
68 {
69 }

◆ testSetTitle()

PollBlockTest::testSetTitle ( )

Definition at line 71 of file PollBlockTest.php.

71 : void
72 {
74 $pb->setTitle("A poll block");
75
76 $this->assertEquals(
77 "A poll block",
78 $pb->getTitle()
79 );
80 }
ilPollBlock $poll_block
setTitle(string $a_title)

References $poll_block, and ilCustomBlock\setTitle().

+ Here is the call graph for this function:

Field Documentation

◆ $poll_block

ilPollBlock PollBlockTest::$poll_block
protected

Definition at line 30 of file PollBlockTest.php.

Referenced by testSetTitle().


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