ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilKioskModeServiceTest Class Reference
+ Inheritance diagram for ilKioskModeServiceTest:
+ Collaboration diagram for ilKioskModeServiceTest:

Public Member Functions

 test_createObject ()
 
 test_getViewFor_non_existing_type ()
 
 test_getViewFor ()
 

Detailed Description

Definition at line 11 of file ilKioskModeServiceTest.php.

Member Function Documentation

◆ test_createObject()

ilKioskModeServiceTest::test_createObject ( )

Definition at line 13 of file ilKioskModeServiceTest.php.

References $lng.

13  : void
14  {
15  $ctrl = $this->createMock(ilCtrl::class);
16  $lng = $this->createMock(ilLanguage::class);
17  $access = $this->createMock(ilAccess::class);
18  $obj_definition = $this->createMock(ilObjectDefinition::class);
19 
20  $obj = new ilKioskModeService($ctrl, $lng, $access, $obj_definition);
21 
22  $this->assertInstanceOf(ilKioskModeService::class, $obj);
23  }
$lng
Central entry point for users of the service.

◆ test_getViewFor()

ilKioskModeServiceTest::test_getViewFor ( )

Definition at line 51 of file ilKioskModeServiceTest.php.

References $lng.

51  : void
52  {
53  $ctrl = $this->createMock(ilCtrl::class);
54  $lng = $this->createMock(ilLanguage::class);
55  $access = $this->createMock(ilAccess::class);
56 
57  $ilObject = $this->createMock(ilObject::class);
58  $ilObject
59  ->expects($this->once())
60  ->method("getType")
61  ->willReturn("testtype")
62  ;
63 
64  $obj_definition = $this->createMock(ilObjectDefinition::class);
65  $obj_definition
66  ->expects($this->exactly(2))
67  ->method("getClassName")
68  ->with("testtype")
69  ->willReturn("Dummy")
70  ;
71 
72 
73  $obj = new ilKioskModeService($ctrl, $lng, $access, $obj_definition);
74  $result = $obj->getViewFor($ilObject);
75 
76  $this->assertInstanceOf(ilDummyKioskModeView::class, $result);
77  }
$lng
Central entry point for users of the service.

◆ test_getViewFor_non_existing_type()

ilKioskModeServiceTest::test_getViewFor_non_existing_type ( )

Definition at line 25 of file ilKioskModeServiceTest.php.

References $lng.

25  : void
26  {
27  $ctrl = $this->createMock(ilCtrl::class);
28  $lng = $this->createMock(ilLanguage::class);
29  $access = $this->createMock(ilAccess::class);
30 
31  $ilObject = $this->createMock(ilObject::class);
32  $ilObject
33  ->expects($this->once())
34  ->method("getType")
35  ->willReturn("testtype")
36  ;
37 
38  $obj_definition = $this->createMock(ilObjectDefinition::class);
39  $obj_definition
40  ->expects($this->exactly(1))
41  ->method("getClassName")
42  ->with("testtype")
43  ->willReturn("wrong")
44  ;
45 
46 
47  $obj = new ilKioskModeService($ctrl, $lng, $access, $obj_definition);
48  $this->assertNull($obj->getViewFor($ilObject));
49  }
$lng
Central entry point for users of the service.

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