Lines Matching refs:code
31 protected function doTestPrettyPrintMethod($method, $name, $code, $expected, $modeLine) { argument
33 $output = canonicalize($prettyPrinter->$method($parser->parse($code)));
40 public function testPrettyPrint($name, $code, $expected, $mode): void { argument
41 $this->doTestPrettyPrintMethod('prettyPrint', $name, $code, $expected, $mode);
47 public function testPrettyPrintFile($name, $code, $expected, $mode): void { argument
48 $this->doTestPrettyPrintMethod('prettyPrintFile', $name, $code, $expected, $mode);
191 …public function testFormatPreservingPrint($name, $code, $modification, $expected, $modeLine): void… argument
195 $oldStmts = $parser->parse($code);
224 public function testRoundTripPrint($name, $code, $expected, $modeLine): void { argument
234 $oldStmts = $parser->parse($code);
245 $this->assertSame(canonicalize($code), canonicalize($newCode), $name);
268 $code = $prettyPrinter->prettyPrint($stmts);
269 $this->assertSame("if (1) {\r\n echo 'Hello';\r\n echo 'World';\r\n}", $code);
270 $code = $prettyPrinter->prettyPrintFile($stmts);
271 … $this->assertSame("<?php\r\n\r\nif (1) {\r\n echo 'Hello';\r\n echo 'World';\r\n}", $code);
274 $code = $prettyPrinter->prettyPrintFile($stmts);
275 $this->assertSame("Hello world", $code);
291 $code = $prettyPrinter->prettyPrint($stmts);
294 $code);