◆ setUp()
JavaScriptBindableTest::setUp |
( |
| ) |
|
◆ test_withAdditionalOnLoadCode()
JavaScriptBindableTest::test_withAdditionalOnLoadCode |
( |
| ) |
|
Definition at line 55 of file JavaScriptBindableTest.php.
56 {
58 ->withOnLoadCode(
function (
$id) {
59 return "Its me, $id!";
60 })
62 return "And again, me: $id.";
63 });
64
65 $binder =
$m->getOnLoadCode();
66 $this->assertInstanceOf(\Closure::class, $binder);
67 $this->assertEquals("Its me, Mario!\nAnd again, me: Mario.", $binder("Mario"));
68 }
if(!array_key_exists('StateId', $_REQUEST)) $id
withAdditionalOnLoadCode(\Closure $binder)
References $id, $m, and ILIAS\UI\Implementation\Component\withAdditionalOnLoadCode().
◆ test_withAdditionalOnLoadCode_no_previous()
JavaScriptBindableTest::test_withAdditionalOnLoadCode_no_previous |
( |
| ) |
|
Definition at line 70 of file JavaScriptBindableTest.php.
71 {
73 ->withAdditionalOnLoadCode(
function (
$id) {
74 return "And again, me: $id.";
75 });
76
77 $binder =
$m->getOnLoadCode();
78 $this->assertInstanceOf(\Closure::class, $binder);
79 $this->assertEquals("And again, me: Mario.", $binder("Mario"));
80 }
References $id, and $m.
◆ test_withOnLoadCode()
JavaScriptBindableTest::test_withOnLoadCode |
( |
| ) |
|
Definition at line 22 of file JavaScriptBindableTest.php.
23 {
24 $m = $this->mock->withOnLoadCode(
function (
$id) {
25 return "Its me, $id!";
26 });
27
28 $binder =
$m->getOnLoadCode();
29 $this->assertInstanceOf(\Closure::class, $binder);
30 $this->assertEquals("Its me, Mario!", $binder("Mario"));
31 }
References $id, and $m.
◆ test_withOnLoadCode_false_closure_1()
JavaScriptBindableTest::test_withOnLoadCode_false_closure_1 |
( |
| ) |
|
Definition at line 33 of file JavaScriptBindableTest.php.
34 {
35 try {
36 $this->mock->withOnLoadCode(function () {
37 });
38 $this->assertFalse("This should not happen...");
39 } catch (\InvalidArgumentException $exception) {
40 $this->assertTrue(true);
41 }
42 }
◆ test_withOnLoadCode_false_closure_2()
JavaScriptBindableTest::test_withOnLoadCode_false_closure_2 |
( |
| ) |
|
Definition at line 44 of file JavaScriptBindableTest.php.
45 {
46 try {
47 $this->mock->withOnLoadCode(
function (
$id, $some_arg) {
48 });
49 $this->assertFalse("This should not happen...");
50 } catch (\InvalidArgumentException $exception) {
51 $this->assertTrue(true);
52 }
53 }
References $id.
The documentation for this class was generated from the following file: