ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilTimingAcceptedTest Class Reference

Class ilTimingAcceptedTest. More...

+ Inheritance diagram for ilTimingAcceptedTest:
+ Collaboration diagram for ilTimingAcceptedTest:

Public Member Functions

 testAcceptance ()
 

Protected Member Functions

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

Protected Attributes

Container $dic
 

Detailed Description

Member Function Documentation

◆ initDependencies()

ilTimingAcceptedTest::initDependencies ( )
protected

Definition at line 70 of file ilTimingAcceptedTest.php.

70 : void
71 {
72 $this->dic = new Container();
73 $GLOBALS['DIC'] = $this->dic;
74 $this->setGlobalVariable('ilDB', $this->createMock(ilDBInterface::class));
75 }
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:36
setGlobalVariable(string $name, $value)
$GLOBALS["DIC"]
Definition: wac.php:54

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

Referenced by setUp().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setGlobalVariable()

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

Definition at line 59 of file ilTimingAcceptedTest.php.

59 : void
60 {
61 global $DIC;
62
63 $GLOBALS[$name] = $value;
64 unset($DIC[$name]);
65 $DIC[$name] = static function (\ILIAS\DI\Container $c) use ($value) {
66 return $value;
67 };
68 }
$c
Definition: deliver.php:25
global $DIC
Definition: shib_login.php:26

References $c, $DIC, and $GLOBALS.

Referenced by initDependencies().

+ Here is the caller graph for this function:

◆ setUp()

ilTimingAcceptedTest::setUp ( )
protected

Definition at line 32 of file ilTimingAcceptedTest.php.

32 : void
33 {
34 parent::setUp();
35 $this->initDependencies();
36 }

References initDependencies().

+ Here is the call graph for this function:

◆ testAcceptance()

ilTimingAcceptedTest::testAcceptance ( )

Definition at line 38 of file ilTimingAcceptedTest.php.

38 : void
39 {
40 $user_id = -1;
41 $course_id = -2;
42 $acc = new ilTimingAccepted($course_id, $user_id);
43 $this->assertInstanceOf(ilTimingAccepted::class, $acc);
44 $this->assertEquals($user_id, $acc->getUserId());
45 $this->assertEquals($course_id, $acc->getCourseId());
46 $this->assertFalse($acc->isAccepted());
47 $this->assertFalse($acc->isVisible());
48 $this->assertEmpty($acc->getRemark());
49
50 $acc->setRemark('remark');
51 $acc->setVisible(true);
52 $acc->accept(true);
53
54 $this->assertTrue($acc->isAccepted());
55 $this->assertTrue($acc->isVisible());
56 $this->assertEquals('remark', $acc->getRemark());
57 }
class ilTimingAccepted

References $user_id.

Field Documentation

◆ $dic

Container ilTimingAcceptedTest::$dic
protected

Definition at line 30 of file ilTimingAcceptedTest.php.

Referenced by initDependencies().


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