ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
PlayerAudioTest Class Reference
+ Inheritance diagram for PlayerAudioTest:
+ Collaboration diagram for PlayerAudioTest:

Public Member Functions

 getUIFactory ()
 
 getFactory ()
 
 testImplementsFactoryInterface ()
 
 testGetTitleGetSource ()
 
 testGetTitleGetTranscript ()
 
 testRenderAudio ()
 
 testRenderWithTranscript ()
 

Detailed Description

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 31 of file PlayerAudioTest.php.

Member Function Documentation

◆ getFactory()

PlayerAudioTest::getFactory ( )

Definition at line 60 of file PlayerAudioTest.php.

Referenced by testGetTitleGetSource(), testGetTitleGetTranscript(), testImplementsFactoryInterface(), testRenderAudio(), and testRenderWithTranscript().

60  : C\Player\Factory
61  {
62  return new I\Component\Player\Factory();
63  }
+ Here is the caller graph for this function:

◆ getUIFactory()

PlayerAudioTest::getUIFactory ( )

Definition at line 33 of file PlayerAudioTest.php.

References ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\button(), and ILIAS\Repository\modal().

33  : NoUIFactory
34  {
35  return new class (
36  $this->createMock(I\Component\Modal\InterruptiveItem\Factory::class),
37  $this->createMock(FieldFactory::class),
38  ) extends NoUIFactory {
39  public function __construct(
40  protected I\Component\Modal\InterruptiveItem\Factory $interruptive_item_factory,
41  protected FieldFactory $field_factory,
42  ) {
43  }
44 
45  public function modal(): I\Component\Modal\Factory
46  {
47  return new I\Component\Modal\Factory(
48  new I\Component\SignalGenerator(),
49  $this->interruptive_item_factory,
50  $this->field_factory,
51  );
52  }
53  public function button(): I\Component\Button\Factory
54  {
55  return new I\Component\Button\Factory();
56  }
57  };
58  }
button(string $caption, string $cmd)
modal(string $title="", string $cancel_label="")
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

◆ testGetTitleGetSource()

PlayerAudioTest::testGetTitleGetSource ( )

Definition at line 74 of file PlayerAudioTest.php.

References Vendor\Package\$f, and getFactory().

74  : void
75  {
76  $f = $this->getFactory();
77 
78  $audio = $f->audio("/foo");
79 
80  $this->assertEquals("/foo", $audio->getSource());
81  }
+ Here is the call graph for this function:

◆ testGetTitleGetTranscript()

PlayerAudioTest::testGetTitleGetTranscript ( )

Definition at line 83 of file PlayerAudioTest.php.

References Vendor\Package\$f, and getFactory().

83  : void
84  {
85  $f = $this->getFactory();
86 
87  $audio = $f->audio("/foo", "bar");
88 
89  $this->assertEquals("bar", $audio->getTranscription());
90  }
+ Here is the call graph for this function:

◆ testImplementsFactoryInterface()

PlayerAudioTest::testImplementsFactoryInterface ( )

Definition at line 65 of file PlayerAudioTest.php.

References Vendor\Package\$f, and getFactory().

65  : void
66  {
67  $f = $this->getFactory();
68 
69  $audio = $f->audio("/foo", "bar");
70 
71  $this->assertInstanceOf("ILIAS\\UI\\Component\\Player\\Audio", $audio);
72  }
+ Here is the call graph for this function:

◆ testRenderAudio()

PlayerAudioTest::testRenderAudio ( )

Definition at line 92 of file PlayerAudioTest.php.

References Vendor\Package\$f, $r, and getFactory().

92  : void
93  {
94  $f = $this->getFactory();
95  $r = $this->getDefaultRenderer();
96 
97  $audio = $f->audio("/foo");
98 
99  $html = $r->render($audio);
100 
101  $expected = <<<EOT
102 <div class="il-audio-container">
103  <audio class="il-audio-player" id="id_1" src="/foo" preload="metadata"></audio>
104 </div>
105 EOT;
106  $this->assertHTMLEquals(
107  $this->brutallyTrimHTML($expected),
108  $this->brutallyTrimHTML($html)
109  );
110  }
$r
+ Here is the call graph for this function:

◆ testRenderWithTranscript()

PlayerAudioTest::testRenderWithTranscript ( )

Definition at line 112 of file PlayerAudioTest.php.

References Vendor\Package\$f, $r, and getFactory().

112  : void
113  {
114  $f = $this->getFactory();
115  $r = $this->getDefaultRenderer();
116 
117  $audio = $f->audio("/foo", "x*123");
118 
119  $html = $r->render($audio);
120 
121  $this->assertEquals(
122  true,
123  is_int(strpos($html, "ui_transcription</button>"))
124  );
125  $this->assertEquals(
126  true,
127  is_int(strpos($html, "il-modal-lightbox"))
128  );
129  $this->assertEquals(
130  true,
131  is_int(strpos($html, "x*123"))
132  );
133  }
$r
+ Here is the call graph for this function:

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