We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8421221 commit ac8c3ccCopy full SHA for ac8c3cc
2 files changed
tests/EnclosingMethodTest.php
@@ -0,0 +1,24 @@
1
+<?php
2
+namespace PHPJava\Tests;
3
+
4
+class EnclosingMethodTest extends Base
5
+{
6
+ protected $fixtures = [
7
+ 'EnclosingMethodTest',
8
+ ];
9
10
+ public function testEnclosingMethod()
11
+ {
12
+ ob_start();
13
+ $this->initiatedJavaClasses['EnclosingMethodTest']
14
+ ->getInvoker()
15
+ ->getStatic()
16
+ ->getMethods()
17
+ ->call(
18
+ 'main',
19
+ []
20
+ );
21
+ $result = ob_get_clean();
22
+ $this->assertEquals("Hello World!\n", $result);
23
+ }
24
+}
tests/fixtures/java/EnclosingMethodTest.java
@@ -0,0 +1,17 @@
+class EnclosingMethodTest
+ public String text;
+ public static void main(String[] args)
+ new EnclosingMethodTest() {{
+ this.text = "Hello World!";
+ callHelloWorld();
+ }};
+ public void callHelloWorld()
+ System.out.println(this.text);
0 commit comments