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

Function TestParseAndPrintComplexString3

printer/printer_parsed_php7_test.go:1523–1545  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1521}
1522
1523func TestParseAndPrintComplexString3(t *testing.T) {
1524 src := `<?php
1525 "test ${foo}" ;
1526 "test ${foo[0]}";
1527 "test ${foo::$bar}";
1528 "test ${foo }" ;
1529 "test ${foo . 'bar' }" ;
1530 "test ${foo [ ] }" ;
1531 "test ${foo [ $b ] }" ;
1532 "test ${foo [ 1 ] }" ;
1533 "test ${foo [ 'expr' . $bar ] }" ;
1534 "test ${$foo }" ;
1535 "test ${$foo -> bar }" ;
1536 "test ${$foo -> bar ( ) }" ;
1537 "test ${$a . '' }" ;
1538 `
1539
1540 actual := print(parse(src))
1541
1542 if src != actual {
1543 t.Errorf("\nexpected: %s\ngot: %s\n", src, actual)
1544 }
1545}
1546
1547func TestParseAndPrintComplexString4(t *testing.T) {
1548 src := `<?php

Callers

nothing calls this directly

Calls 2

printFunction · 0.85
parseFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…