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

68 : void
69 {
70 $this->dic = new Container();
71 $GLOBALS['DIC'] = $this->dic;
72 $this->setGlobalVariable('ilDB', $this->createMock(ilDBInterface::class));
73 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:32
setGlobalVariable(string $name, $value)

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 57 of file ilTimingAcceptedTest.php.

57 : void
58 {
59 global $DIC;
60
61 $GLOBALS[$name] = $value;
62 unset($DIC[$name]);
63 $DIC[$name] = static function (\ILIAS\DI\Container $c) use ($value) {
64 return $value;
65 };
66 }
$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 initDependencies().

+ Here is the caller graph for this function:

◆ setUp()

ilTimingAcceptedTest::setUp ( )
protected

Definition at line 30 of file ilTimingAcceptedTest.php.

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

References initDependencies().

+ Here is the call graph for this function:

◆ testAcceptance()

ilTimingAcceptedTest::testAcceptance ( )

Definition at line 36 of file ilTimingAcceptedTest.php.

36 : void
37 {
38 $user_id = -1;
39 $course_id = -2;
40 $acc = new ilTimingAccepted($course_id, $user_id);
41 $this->assertInstanceOf(ilTimingAccepted::class, $acc);
42 $this->assertEquals($user_id, $acc->getUserId());
43 $this->assertEquals($course_id, $acc->getCourseId());
44 $this->assertFalse($acc->isAccepted());
45 $this->assertFalse($acc->isVisible());
46 $this->assertEmpty($acc->getRemark());
47
48 $acc->setRemark('remark');
49 $acc->setVisible(true);
50 $acc->accept(true);
51
52 $this->assertTrue($acc->isAccepted());
53 $this->assertTrue($acc->isVisible());
54 $this->assertEquals('remark', $acc->getRemark());
55 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

Field Documentation

◆ $dic

Container ilTimingAcceptedTest::$dic
protected

Definition at line 28 of file ilTimingAcceptedTest.php.

Referenced by initDependencies().


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