File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <?php
2+ namespace PHPJava \Tests ;
3+
4+ use PHPUnit \Framework \TestCase ;
5+
6+ class InvokeOperationsTest extends Base
7+ {
8+ protected $ fixtures = [
9+ 'InvokeDynamicTest ' ,
10+ ];
11+
12+ public function testInvokeInterface ()
13+ {
14+ ob_start ();
15+ $ this ->initiatedJavaClasses ['InvokeDynamicTest ' ]
16+ ->getInvoker ()
17+ ->getStatic ()
18+ ->getMethods ()
19+ ->call (
20+ 'main ' ,
21+ []
22+ );
23+ $ getHelloWorld = ob_get_clean ();
24+ $ this ->assertEquals ("Hello World! \n" , $ getHelloWorld );
25+ }
26+ }
Original file line number Diff line number Diff line change 1+ class InvokeDynamicTest
2+ {
3+ interface InterfaceTest
4+ {
5+ public String callee (String name );
6+ }
7+
8+ public static void main (String [] args )
9+ {
10+ InterfaceTest it = v -> { return "Hello" + v ; };
11+ System .out .println (it .callee (" World!" ));
12+ }
13+ }
You can’t perform that action at this time.
0 commit comments