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

Function TestPrivateProtectedClassMethod

node/stmt/t_class_method_test.go:90–220  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

88}
89
90func TestPrivateProtectedClassMethod(t *testing.T) {
91 src := `<? class foo{ final private function bar() {} protected function baz() {} }`
92
93 expected := &node.Root{
94 Position: &position.Position{
95 StartLine: 1,
96 EndLine: 1,
97 StartPos: 3,
98 EndPos: 75,
99 },
100 Stmts: []node.Node{
101 &stmt.Class{
102 Position: &position.Position{
103 StartLine: 1,
104 EndLine: 1,
105 StartPos: 3,
106 EndPos: 75,
107 },
108 PhpDocComment: "",
109 ClassName: &node.Identifier{
110 Position: &position.Position{
111 StartLine: 1,
112 EndLine: 1,
113 StartPos: 9,
114 EndPos: 12,
115 },
116 Value: "foo",
117 },
118 Stmts: []node.Node{
119 &stmt.ClassMethod{
120 Position: &position.Position{
121 StartLine: 1,
122 EndLine: 1,
123 StartPos: 14,
124 EndPos: 45,
125 },
126 ReturnsRef: false,
127 PhpDocComment: "",
128 MethodName: &node.Identifier{
129 Position: &position.Position{
130 StartLine: 1,
131 EndLine: 1,
132 StartPos: 37,
133 EndPos: 40,
134 },
135 Value: "bar",
136 },
137 Modifiers: []node.Node{
138 &node.Identifier{
139 Position: &position.Position{
140 StartLine: 1,
141 EndLine: 1,
142 StartPos: 14,
143 EndPos: 19,
144 },
145 Value: "final",
146 },
147 &node.Identifier{

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…