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

Function TestPrintStaticCall

printer/pretty_printer_test.go:1920–1945  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1918}
1919
1920func TestPrintStaticCall(t *testing.T) {
1921 o := bytes.NewBufferString("")
1922
1923 p := printer.NewPrettyPrinter(o, " ")
1924 p.Print(&expr.StaticCall{
1925 Class: &node.Identifier{Value: "Foo"},
1926 Call: &node.Identifier{Value: "bar"},
1927 ArgumentList: &node.ArgumentList{
1928 Arguments: []node.Node{
1929 &node.Argument{
1930 Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
1931 },
1932 &node.Argument{
1933 Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}},
1934 },
1935 },
1936 },
1937 })
1938
1939 expected := `Foo::bar($a, $b)`
1940 actual := o.String()
1941
1942 if expected != actual {
1943 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
1944 }
1945}
1946
1947func TestPrintStaticPropertyFetch(t *testing.T) {
1948 o := bytes.NewBufferString("")

Callers

nothing calls this directly

Calls 3

PrintMethod · 0.95
NewPrettyPrinterFunction · 0.92
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…