ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
LSPlayerTest Class Reference
+ Inheritance diagram for LSPlayerTest:
+ Collaboration diagram for LSPlayerTest:

Public Member Functions

 testLearningSequenceNextAvailableIsSame ()
 
 testLearningSequenceNextAvailableIsNull ()
 
 testLearningSequenceNextAvailableBackwards ()
 
 testLearningSequenceNextAvailableForwards ()
 

Protected Member Functions

 setUp ()
 

Protected Attributes

LSLearnerItem $available
 
LSLearnerItem $unavailable
 
ilLSPlayer $player
 

Detailed Description

Definition at line 24 of file LSPlayerTest.php.

Member Function Documentation

◆ setUp()

LSPlayerTest::setUp ( )
protected

Definition at line 30 of file LSPlayerTest.php.

30 : void
31 {
32 $this->available = $this->createMock(LSLearnerItem::class);
33 $this->available->method('getAvailability')
34 ->willReturn(Step::AVAILABLE);
35 $this->unavailable = $this->createMock(LSLearnerItem::class);
36 $this->unavailable->method('getAvailability')
37 ->willReturn(Step::NOT_AVAILABLE);
38
39 $this->player = new class () extends ilLSPlayer {
40 public function __construct()
41 {
42 }
43 public function _getNextAvailableItem(
44 array $items,
45 LSLearnerItem $current_item
46 ): ?LSLearnerItem {
47 return parent::getNextAvailableItem($items, $current_item);
48 }
49 };
50 }
Add learning progress and availability information to the LSItem.
Implementation of KioskMode Player.
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

◆ testLearningSequenceNextAvailableBackwards()

LSPlayerTest::testLearningSequenceNextAvailableBackwards ( )

Definition at line 82 of file LSPlayerTest.php.

83 {
84 $items = [
86 clone $this->available, //expected
88 clone $this->unavailable, //current
89 clone $this->available,
90 ];
91 $current = $items[3];
92 $this->assertEquals(
93 1,
94 array_search($this->player->_getNextAvailableItem($items, $current), $items)
95 );
96 }
LSLearnerItem $available
LSLearnerItem $unavailable

References $available, and $unavailable.

◆ testLearningSequenceNextAvailableForwards()

LSPlayerTest::testLearningSequenceNextAvailableForwards ( )

Definition at line 98 of file LSPlayerTest.php.

99 {
100 $items = [
101 clone $this->unavailable,
102 clone $this->unavailable, //current
103 clone $this->unavailable,
104 clone $this->available, //expected
105 clone $this->available,
106 ];
107 $current = $items[1];
108 $this->assertEquals(
109 3,
110 array_search($this->player->_getNextAvailableItem($items, $current), $items)
111 );
112 }

References $available, and $unavailable.

◆ testLearningSequenceNextAvailableIsNull()

LSPlayerTest::testLearningSequenceNextAvailableIsNull ( )

Definition at line 69 of file LSPlayerTest.php.

70 {
71 $items = [
75 ];
76 $current = $items[1];
77 $this->assertNull(
78 $this->player->_getNextAvailableItem($items, $current)
79 );
80 }

References $unavailable.

◆ testLearningSequenceNextAvailableIsSame()

LSPlayerTest::testLearningSequenceNextAvailableIsSame ( )

Definition at line 52 of file LSPlayerTest.php.

53 {
54 $items = [
55 clone $this->available,
56 clone $this->available,
57 clone $this->available,
59 ];
60 $this->assertNotSame($items[0], $items[2]);
61 $this->assertEquals(Step::AVAILABLE, $items[1]->getAvailability());
62 $this->assertEquals(Step::NOT_AVAILABLE, $items[3]->getAvailability());
63
64 $current = $items[1];
65 $next = $this->player->_getNextAvailableItem($items, $current);
66 $this->assertSame($current, $next);
67 }

References $available, and $unavailable.

Field Documentation

◆ $available

◆ $player

ilLSPlayer LSPlayerTest::$player
protected

Definition at line 28 of file LSPlayerTest.php.

◆ $unavailable


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