More PrettyPrinter tests

This commit is contained in:
Aydin 2015-10-01 16:32:24 +01:00 committed by Nikita Popov
parent 39a039fa42
commit 99e89743bd
9 changed files with 139 additions and 0 deletions

View File

@ -0,0 +1,9 @@
continue
-----
<?php
continue;
continue 2;
-----
continue;
continue 2;

View File

@ -0,0 +1,10 @@
doWhile
-----
<?php
do {
} while (true);
-----
do {
} while (true);

View File

@ -0,0 +1,28 @@
for
-----
<?php
for ($i = 0; $i < 10; $i++) {
}
for ($i = 0,$j = 0; $i < 10; $i++) {
}
for ($i = 0; $i < 10;) {
}
for (;;) {
}
-----
for ($i = 0; $i < 10; $i++) {
}
for ($i = 0, $j = 0; $i < 10; $i++) {
}
for ($i = 0; $i < 10;) {
}
for (;;) {
}

View File

@ -0,0 +1,28 @@
foreach
-----
<?php
foreach ($arr as $val) {
}
foreach ($arr as &$val) {
}
foreach ($arr as $key => $val) {
}
foreach ($arr as $key => &$val) {
}
-----
foreach ($arr as $val) {
}
foreach ($arr as &$val) {
}
foreach ($arr as $key => $val) {
}
foreach ($arr as $key => &$val) {
}

View File

@ -0,0 +1,7 @@
goto
-----
<?php
goto marker;
-----
goto marker;

View File

@ -0,0 +1,16 @@
if/elseif/else
-----
<?php
if ($expr) {
} elseif ($expr2) {
} else {
}
-----
if ($expr) {
} elseif ($expr2) {
} else {
}

View File

@ -0,0 +1,7 @@
throw
-----
<?php
throw $e;
-----
throw $e;

View File

@ -0,0 +1,24 @@
tryCatch
-----
<?php
try {
} catch (Exception $e) {
}
try {
} catch (Exception $e) {
} finally {
}
-----
try {
} catch (Exception $e) {
}
try {
} catch (Exception $e) {
} finally {
}

View File

@ -0,0 +1,10 @@
while
-----
<?php
while (true) {
}
-----
while (true) {
}