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

Function TestPrinterPrintInstanceOf

printer/printer_test.go:1962–1979  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1960}
1961
1962func TestPrinterPrintInstanceOf(t *testing.T) {
1963 o := bytes.NewBufferString("")
1964
1965 p := printer.NewPrinter(o)
1966 p.Print(&expr.InstanceOf{
1967 Expr: &expr.Variable{
1968 VarName: &node.Identifier{Value: "var"},
1969 },
1970 Class: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}},
1971 })
1972
1973 expected := `$var instanceof Foo`
1974 actual := o.String()
1975
1976 if expected != actual {
1977 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
1978 }
1979}
1980
1981func TestPrinterPrintIsset(t *testing.T) {
1982 o := bytes.NewBufferString("")

Callers

nothing calls this directly

Calls 3

PrintMethod · 0.95
NewPrinterFunction · 0.92
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…