5 require_once(
"libs/composer/vendor/autoload.php");
24 $m = $this->mock->withOnLoadCode(
function (
$id) {
25 return "Its me, $id!";
28 $binder =
$m->getOnLoadCode();
29 $this->assertInstanceOf(\Closure::class, $binder);
30 $this->assertEquals(
"Its me, Mario!", $binder(
"Mario"));
36 $this->mock->withOnLoadCode(
function () {
38 $this->assertFalse(
"This should not happen...");
40 $this->assertTrue(
true);
47 $this->mock->withOnLoadCode(
function (
$id, $some_arg) {
49 $this->assertFalse(
"This should not happen...");
51 $this->assertTrue(
true);
58 ->withOnLoadCode(
function (
$id) {
59 return "Its me, $id!";
62 return "And again, me: $id.";
65 $binder =
$m->getOnLoadCode();
66 $this->assertInstanceOf(\Closure::class, $binder);
67 $this->assertEquals(
"Its me, Mario!\nAnd again, me: Mario.", $binder(
"Mario"));
73 ->withAdditionalOnLoadCode(
function (
$id) {
74 return "And again, me: $id.";
77 $binder =
$m->getOnLoadCode();
78 $this->assertInstanceOf(\Closure::class, $binder);
79 $this->assertEquals(
"And again, me: Mario.", $binder(
"Mario"));
test_withOnLoadCode_false_closure_1()
trait JavaScriptBindable
Trait for components implementing JavaScriptBindable providing standard implementation.
if(!array_key_exists('StateId', $_REQUEST)) $id
test_withOnLoadCode_false_closure_2()
withAdditionalOnLoadCode(\Closure $binder)
test_withAdditionalOnLoadCode()
test_withAdditionalOnLoadCode_no_previous()