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

Function TestMul

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

Source from the content-addressed store, hash-verified

1285}
1286
1287func TestMul(t *testing.T) {
1288 src := `<? $a * $b;`
1289
1290 expected := &node.Root{
1291 Position: &position.Position{
1292 StartLine: 1,
1293 EndLine: 1,
1294 StartPos: 3,
1295 EndPos: 11,
1296 },
1297 Stmts: []node.Node{
1298 &stmt.Expression{
1299 Position: &position.Position{
1300 StartLine: 1,
1301 EndLine: 1,
1302 StartPos: 3,
1303 EndPos: 11,
1304 },
1305 Expr: &binary.Mul{
1306 Position: &position.Position{
1307 StartLine: 1,
1308 EndLine: 1,
1309 StartPos: 3,
1310 EndPos: 10,
1311 },
1312 Left: &expr.Variable{
1313 Position: &position.Position{
1314 StartLine: 1,
1315 EndLine: 1,
1316 StartPos: 3,
1317 EndPos: 5,
1318 },
1319 VarName: &node.Identifier{
1320 Position: &position.Position{
1321 StartLine: 1,
1322 EndLine: 1,
1323 StartPos: 3,
1324 EndPos: 5,
1325 },
1326 Value: "a",
1327 },
1328 },
1329 Right: &expr.Variable{
1330 Position: &position.Position{
1331 StartLine: 1,
1332 EndLine: 1,
1333 StartPos: 8,
1334 EndPos: 10,
1335 },
1336 VarName: &node.Identifier{
1337 Position: &position.Position{
1338 StartLine: 1,
1339 EndLine: 1,
1340 StartPos: 8,
1341 EndPos: 10,
1342 },
1343 Value: "b",
1344 },

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…