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

Function TestParseAndPrintComplexString2

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

Source from the content-addressed store, hash-verified

1500}
1501
1502func TestParseAndPrintComplexString2(t *testing.T) {
1503 src := `<?php
1504 "test ${ foo }" ;
1505 "test ${ foo . 'bar' }" ;
1506 "test ${ foo [ ] }" ;
1507 "test ${ foo [ $b ] }" ;
1508 "test ${ foo [ 1 ] }" ;
1509 "test ${ foo [ 'expr' . $bar ] }" ;
1510 "test ${ $foo }" ;
1511 "test ${ $foo -> bar }" ;
1512 "test ${ $foo -> bar ( ) }" ;
1513 "test ${ $a . '' }" ;
1514 `
1515
1516 actual := print(parse(src))
1517
1518 if src != actual {
1519 t.Errorf("\nexpected: %s\ngot: %s\n", src, actual)
1520 }
1521}
1522
1523func TestParseAndPrintComplexString3(t *testing.T) {
1524 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…