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

Function TestMinus

node/expr/binary/t_binary_op_test.go:1137–1210  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1135}
1136
1137func TestMinus(t *testing.T) {
1138 src := `<? $a - $b;`
1139
1140 expected := &node.Root{
1141 Position: &position.Position{
1142 StartLine: 1,
1143 EndLine: 1,
1144 StartPos: 3,
1145 EndPos: 11,
1146 },
1147 Stmts: []node.Node{
1148 &stmt.Expression{
1149 Position: &position.Position{
1150 StartLine: 1,
1151 EndLine: 1,
1152 StartPos: 3,
1153 EndPos: 11,
1154 },
1155 Expr: &binary.Minus{
1156 Position: &position.Position{
1157 StartLine: 1,
1158 EndLine: 1,
1159 StartPos: 3,
1160 EndPos: 10,
1161 },
1162 Left: &expr.Variable{
1163 Position: &position.Position{
1164 StartLine: 1,
1165 EndLine: 1,
1166 StartPos: 3,
1167 EndPos: 5,
1168 },
1169 VarName: &node.Identifier{
1170 Position: &position.Position{
1171 StartLine: 1,
1172 EndLine: 1,
1173 StartPos: 3,
1174 EndPos: 5,
1175 },
1176 Value: "a",
1177 },
1178 },
1179 Right: &expr.Variable{
1180 Position: &position.Position{
1181 StartLine: 1,
1182 EndLine: 1,
1183 StartPos: 8,
1184 EndPos: 10,
1185 },
1186 VarName: &node.Identifier{
1187 Position: &position.Position{
1188 StartLine: 1,
1189 EndLine: 1,
1190 StartPos: 8,
1191 EndPos: 10,
1192 },
1193 Value: "b",
1194 },

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…