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

Function TestParseAndPrintArrayDimFetch

printer/printer_parsed_php7_test.go:360–379  ·  view source on GitHub ↗

test expr

(t *testing.T)

Source from the content-addressed store, hash-verified

358// test expr
359
360func TestParseAndPrintArrayDimFetch(t *testing.T) {
361 src := `<?php
362 FOO [ ] ;
363 FOO [ 1 ] ;
364 $a [ ] ;
365 $a [ 1 ] ;
366 $a { 1 } ;
367 new $a [ ] ;
368 new $a [ 1 ] ;
369 new $a { 1 } ;
370 "$a[1]test" ;
371 "${ a [ 1 ] }test" ;
372 `
373
374 actual := print(parse(src))
375
376 if src != actual {
377 t.Errorf("\nexpected: %s\ngot: %s\n", src, actual)
378 }
379}
380
381func TestParseAndPrintArrayItem(t *testing.T) {
382 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…