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 OutputDebugTraceTest extends Base
7+ {
8+ protected $ fixtures = [
9+ 'OutputDebugTraceTest ' ,
10+ ];
11+
12+ /**
13+ * @var \PHPJava\Core\JavaClass
14+ */
15+ private $ javaClass ;
16+
17+ public function setUp (): void
18+ {
19+ parent ::setUp ();
20+
21+ $ this ->javaClass = new \PHPJava \Core \JavaClass (
22+ new \PHPJava \Core \JavaClassReader ($ this ->getClassName ('OutputDebugTraceTest ' ))
23+ );
24+ }
25+
26+ public function testCallMain ()
27+ {
28+ ob_start ();
29+ $ this ->javaClass ->getInvoker ()->getStaticMethods ()->call (
30+ 'main ' ,
31+ ["Hello " , " " , "World " ]
32+ );
33+ ob_end_clean ();
34+
35+ ob_start ();
36+ $ this ->javaClass ->debug ();
37+ $ result = ob_get_clean ();
38+ $ this ->assertEquals (
39+ file_get_contents (__DIR__ . '/templates/DebugTraceTest.txt ' ),
40+ $ result
41+ );
42+ }
43+ }
Original file line number Diff line number Diff line change 1+ class OutputDebugTraceTest
2+ {
3+ public static void main (String [] args )
4+ {
5+ System .out .print (args [0 ]);
6+ System .out .print (args [1 ]);
7+ System .out .print (args [2 ]);
8+ }
9+ }
Original file line number Diff line number Diff line change 1+ [method]
2+ public static void main(java.lang.String[])
3+
4+ [code]
5+ [1m[35m<0xb2>[m <0x00> <0x02> [1m[35m<0x2a>[m [1m[35m<0x03>[m [1m[35m<0x32>[m [1m[35m<0xb6>[m <0x00> <0x03> [1m[35m<0xb2>[m <0x00> <0x02> [1m[35m<0x2a>[m [1m[35m<0x04>[m [1m[35m<0x32>[m [1m[35m<0xb6>[m <0x00> <0x03> [1m[35m<0xb2>[m <0x00>
6+ <0x02> [1m[35m<0x2a>[m [1m[35m<0x05>[m [1m[35m<0x32>[m [1m[35m<0xb6>[m <0x00> <0x03> [1m[35m<0xb1>[m
7+
8+ [executed]
9+ PC | OPCODE | MNEMONIC | OPERANDS | LOCAL STORAGE
10+ ---------+--------+----------------------+------------+-----------------
11+ 0 | 0xB2 | getstatic | 0 | 1
12+ 3 | 0x2A | aload_0 | 1 | 1
13+ 4 | 0x03 | iconst_0 | 2 | 1
14+ 5 | 0x32 | aaload | 3 | 1
15+ 6 | 0xB6 | invokevirtual | 2 | 1
16+ 9 | 0xB2 | getstatic | 0 | 1
17+ 12 | 0x2A | aload_0 | 1 | 1
18+ 13 | 0x04 | iconst_1 | 2 | 1
19+ 14 | 0x32 | aaload | 3 | 1
20+ 15 | 0xB6 | invokevirtual | 2 | 1
21+ 18 | 0xB2 | getstatic | 0 | 1
22+ 21 | 0x2A | aload_0 | 1 | 1
23+ 22 | 0x05 | iconst_2 | 2 | 1
24+ 23 | 0x32 | aaload | 3 | 1
25+ 24 | 0xB6 | invokevirtual | 2 | 1
26+ 27 | 0xB1 | return | 0 | 1
27+ ---------+--------+----------------------+------------+-----------------
28+
You can’t perform that action at this time.
0 commit comments