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

Function TestPlus

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

Source from the content-addressed store, hash-verified

1510}
1511
1512func TestPlus(t *testing.T) {
1513 src := `<? $a + $b;`
1514
1515 expected := &node.Root{
1516 Position: &position.Position{
1517 StartLine: 1,
1518 EndLine: 1,
1519 StartPos: 3,
1520 EndPos: 11,
1521 },
1522 Stmts: []node.Node{
1523 &stmt.Expression{
1524 Position: &position.Position{
1525 StartLine: 1,
1526 EndLine: 1,
1527 StartPos: 3,
1528 EndPos: 11,
1529 },
1530 Expr: &binary.Plus{
1531 Position: &position.Position{
1532 StartLine: 1,
1533 EndLine: 1,
1534 StartPos: 3,
1535 EndPos: 10,
1536 },
1537 Left: &expr.Variable{
1538 Position: &position.Position{
1539 StartLine: 1,
1540 EndLine: 1,
1541 StartPos: 3,
1542 EndPos: 5,
1543 },
1544 VarName: &node.Identifier{
1545 Position: &position.Position{
1546 StartLine: 1,
1547 EndLine: 1,
1548 StartPos: 3,
1549 EndPos: 5,
1550 },
1551 Value: "a",
1552 },
1553 },
1554 Right: &expr.Variable{
1555 Position: &position.Position{
1556 StartLine: 1,
1557 EndLine: 1,
1558 StartPos: 8,
1559 EndPos: 10,
1560 },
1561 VarName: &node.Identifier{
1562 Position: &position.Position{
1563 StartLine: 1,
1564 EndLine: 1,
1565 StartPos: 8,
1566 EndPos: 10,
1567 },
1568 Value: "b",
1569 },

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…