MCPcopy Create free account
hub / github.com/z7zmey/php-parser / TestShellExec

Function TestShellExec

node/expr/t_shell_exec_test.go:19–86  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

17)
18
19func TestShellExec(t *testing.T) {
20 src := "<? `cmd $a`;"
21
22 expected := &node.Root{
23 Position: &position.Position{
24 StartLine: 1,
25 EndLine: 1,
26 StartPos: 3,
27 EndPos: 12,
28 },
29 Stmts: []node.Node{
30 &stmt.Expression{
31 Position: &position.Position{
32 StartLine: 1,
33 EndLine: 1,
34 StartPos: 3,
35 EndPos: 12,
36 },
37 Expr: &expr.ShellExec{
38 Position: &position.Position{
39 StartLine: 1,
40 EndLine: 1,
41 StartPos: 3,
42 EndPos: 11,
43 },
44 Parts: []node.Node{
45 &scalar.EncapsedStringPart{
46 Position: &position.Position{
47 StartLine: 1,
48 EndLine: 1,
49 StartPos: 4,
50 EndPos: 8,
51 },
52 Value: "cmd ",
53 },
54 &expr.Variable{
55 Position: &position.Position{
56 StartLine: 1,
57 EndLine: 1,
58 StartPos: 8,
59 EndPos: 10,
60 },
61 VarName: &node.Identifier{
62 Position: &position.Position{
63 StartLine: 1,
64 EndLine: 1,
65 StartPos: 8,
66 EndPos: 10,
67 },
68 Value: "a",
69 },
70 },
71 },
72 },
73 },
74 },
75 }
76

Callers

nothing calls this directly

Calls 4

ParseMethod · 0.95
GetRootNodeMethod · 0.95
NewParserFunction · 0.92
NewParserFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…