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

Function TestPhp7AbstractClassMethod

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

Source from the content-addressed store, hash-verified

518}
519
520func TestPhp7AbstractClassMethod(t *testing.T) {
521 src := `<? abstract class Foo{ public function bar(): void; }`
522
523 expected := &node.Root{
524 Position: &position.Position{
525 StartLine: 1,
526 EndLine: 1,
527 StartPos: 3,
528 EndPos: 53,
529 },
530 Stmts: []node.Node{
531 &stmt.Class{
532 Position: &position.Position{
533 StartLine: 1,
534 EndLine: 1,
535 StartPos: 3,
536 EndPos: 53,
537 },
538 PhpDocComment: "",
539 ClassName: &node.Identifier{
540 Position: &position.Position{
541 StartLine: 1,
542 EndLine: 1,
543 StartPos: 18,
544 EndPos: 21,
545 },
546 Value: "Foo",
547 },
548 Modifiers: []node.Node{
549 &node.Identifier{
550 Position: &position.Position{
551 StartLine: 1,
552 EndLine: 1,
553 StartPos: 3,
554 EndPos: 11,
555 },
556 Value: "abstract",
557 },
558 },
559 Stmts: []node.Node{
560 &stmt.ClassMethod{
561 Position: &position.Position{
562 StartLine: 1,
563 EndLine: 1,
564 StartPos: 23,
565 EndPos: 51,
566 },
567 ReturnsRef: false,
568 PhpDocComment: "",
569 MethodName: &node.Identifier{
570 Position: &position.Position{
571 StartLine: 1,
572 EndLine: 1,
573 StartPos: 39,
574 EndPos: 42,
575 },
576 Value: "bar",
577 },

Callers

nothing calls this directly

Calls 3

ParseMethod · 0.95
GetRootNodeMethod · 0.95
NewParserFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…