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

Function TestPrinterPrintStmtGroupUse

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

Source from the content-addressed store, hash-verified

3678}
3679
3680func TestPrinterPrintStmtGroupUse(t *testing.T) {
3681 o := bytes.NewBufferString("")
3682
3683 p := printer.NewPrinter(o)
3684 p.Print(&stmt.GroupUse{
3685 UseType: &node.Identifier{Value: "function"},
3686 Prefix: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}},
3687 UseList: []node.Node{
3688 &stmt.Use{
3689 Use: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Bar"}}},
3690 Alias: &node.Identifier{Value: "Baz"},
3691 },
3692 &stmt.Use{
3693 Use: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Quuz"}}},
3694 },
3695 },
3696 })
3697
3698 expected := `use function Foo\{Bar as Baz,Quuz};`
3699 actual := o.String()
3700
3701 if expected != actual {
3702 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
3703 }
3704}
3705
3706func TestPrinterPrintHaltCompiler(t *testing.T) {
3707 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…