19 declare(strict_types=1);
    25 require_once(
"libs/composer/vendor/autoload.php");
    47         $m = $this->mock->withOnLoadCode(
function (
$id) {
    48             return "Its me, $id!";
    51         $binder = $m->getOnLoadCode();
    52         $this->assertInstanceOf(Closure::class, $binder);
    53         $this->assertEquals(
"Its me, Mario!", $binder(
"Mario"));
    59             $this->mock->withOnLoadCode(
function (): 
void {
    61             $this->assertFalse(
"This should not happen...");
    63             $this->assertTrue(
true);
    70             $this->mock->withOnLoadCode(
function (
$id, $some_arg): 
void {
    72             $this->assertFalse(
"This should not happen...");
    74             $this->assertTrue(
true);
    81             ->withOnLoadCode(
function (
$id) {
    82                 return "Its me, $id!";
    85                 return "And again, me: $id.";
    88         $binder = $m->getOnLoadCode();
    89         $this->assertInstanceOf(Closure::class, $binder);
    90         $this->assertEquals(
"Its me, Mario!\nAnd again, me: Mario.", $binder(
"Mario"));
    96             ->withAdditionalOnLoadCode(
function (
$id) {
    97                 return "And again, me: $id.";
   100         $binder = $m->getOnLoadCode();
   101         $this->assertInstanceOf(Closure::class, $binder);
   102         $this->assertEquals(
"And again, me: Mario.", $binder(
"Mario"));
 
trait JavaScriptBindable
Trait for components implementing JavaScriptBindable providing standard implementation. 
 
testWithOnLoadCodeFalseClosure1()
 
testWithAdditionalOnLoadCodeNoPrevious()
 
testWithAdditionalOnLoadCode()
 
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins 
 
withAdditionalOnLoadCode(Closure $binder)
Add some onload-code to the component instead of replacing the existing one. 
 
testWithOnLoadCodeFalseClosure2()
 
Interface to be extended by components that have the possibility to bind to Javascript.