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

Function TestBooleanOr

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

Source from the content-addressed store, hash-verified

315}
316
317func TestBooleanOr(t *testing.T) {
318 src := `<? $a || $b;`
319
320 expected := &node.Root{
321 Position: &position.Position{
322 StartLine: 1,
323 EndLine: 1,
324 StartPos: 3,
325 EndPos: 12,
326 },
327 Stmts: []node.Node{
328 &stmt.Expression{
329 Position: &position.Position{
330 StartLine: 1,
331 EndLine: 1,
332 StartPos: 3,
333 EndPos: 12,
334 },
335 Expr: &binary.BooleanOr{
336 Position: &position.Position{
337 StartLine: 1,
338 EndLine: 1,
339 StartPos: 3,
340 EndPos: 11,
341 },
342 Left: &expr.Variable{
343 Position: &position.Position{
344 StartLine: 1,
345 EndLine: 1,
346 StartPos: 3,
347 EndPos: 5,
348 },
349 VarName: &node.Identifier{
350 Position: &position.Position{
351 StartLine: 1,
352 EndLine: 1,
353 StartPos: 3,
354 EndPos: 5,
355 },
356 Value: "a",
357 },
358 },
359 Right: &expr.Variable{
360 Position: &position.Position{
361 StartLine: 1,
362 EndLine: 1,
363 StartPos: 9,
364 EndPos: 11,
365 },
366 VarName: &node.Identifier{
367 Position: &position.Position{
368 StartLine: 1,
369 EndLine: 1,
370 StartPos: 9,
371 EndPos: 11,
372 },
373 Value: "b",
374 },

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…