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

Class InitCtrlServiceTest. More...

+ Inheritance diagram for InitCtrlServiceTest:
+ Collaboration diagram for InitCtrlServiceTest:

Public Member Functions

 testCtrlServiceInitializationWithoutRefinery ()
 
 testCtrlServiceInitializationWithoutHttpServices ()
 
 testCtrlServiceInitializationSuccess ()
 

Detailed Description

Member Function Documentation

◆ testCtrlServiceInitializationSuccess()

InitCtrlServiceTest::testCtrlServiceInitializationSuccess ( )

Definition at line 67 of file InitCtrlServiceTest.php.

67 : void
68 {
69 $dic = new Container();
70 $dic['refinery'] = $this->createMock(Refinery::class);
71 // $dic['ilDB'] = $this->createMock(ilDBInterface::class);
72 $dic['http.response_sender_strategy'] = $this->createMock(DefaultResponseSenderStrategy::class);
73 $dic['http'] = $this->createMock(HttpService::class);
74 $dic['http']
75 ->method('request')
76 ->willReturn(
77 $this->createMock(ServerRequestInterface::class)
78 );
79 $dic['component.factory'] = $this->createMock(ilComponentFactory::class);
80
81 $this->assertFalse(isset($dic['ilCtrl']));
82
83 (new InitCtrlService())->init($dic);
84
85 $this->assertTrue(isset($dic['ilCtrl']));
86 $this->assertInstanceOf(
87 ilCtrlInterface::class,
88 $dic->ctrl()
89 );
90 }
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:36
Class InitCtrlService wraps the initialization of ilCtrl.
$dic
Definition: ltiresult.php:33

References $dic, and init().

+ Here is the call graph for this function:

◆ testCtrlServiceInitializationWithoutHttpServices()

InitCtrlServiceTest::testCtrlServiceInitializationWithoutHttpServices ( )

Definition at line 45 of file InitCtrlServiceTest.php.

45 : void
46 {
47 $dic = new Container();
48 // $dic['ilDB'] = $this->createMock(ilDBInterface::class);
49 $dic['refinery'] = $this->createMock(Refinery::class);
50
51 $this->expectException(ilCtrlException::class);
52 $this->expectExceptionMessage("Cannot initialize ilCtrl if HTTP Services are not yet available.");
53 (new InitCtrlService())->init($dic);
54 }

References $dic, and init().

+ Here is the call graph for this function:

◆ testCtrlServiceInitializationWithoutRefinery()

InitCtrlServiceTest::testCtrlServiceInitializationWithoutRefinery ( )

Definition at line 34 of file InitCtrlServiceTest.php.

34 : void
35 {
36 $dic = new Container();
37 // $dic['ilDB'] = $this->createMock(ilDBInterface::class);
38 $dic['http'] = $this->createMock(HttpService::class);
39
40 $this->expectException(ilCtrlException::class);
41 $this->expectExceptionMessage("Cannot initialize ilCtrl if Refinery Factory is not yet available.");
42 (new InitCtrlService())->init($dic);
43 }

References $dic, and init().

+ Here is the call graph for this function:

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