Security update for Core, with self-updated composer
[yaffs-website] / vendor / nikic / php-parser / test / code / prettyPrinter / stmt / switch.test
diff --git a/vendor/nikic/php-parser/test/code/prettyPrinter/stmt/switch.test b/vendor/nikic/php-parser/test/code/prettyPrinter/stmt/switch.test
new file mode 100644 (file)
index 0000000..871ff54
--- /dev/null
@@ -0,0 +1,37 @@
+switch/case/default
+-----
+<?php
+
+switch ($expr) {
+    case 0:
+        echo 'First case, with a break';
+        break;
+    case 1:
+        echo 'Second case, which falls through';
+    case 2:
+    case 3:
+    case 4:
+        echo 'Third case, return instead of break';
+        return;
+    // Comment
+    default:
+        echo 'Default case';
+        break;
+}
+-----
+switch ($expr) {
+    case 0:
+        echo 'First case, with a break';
+        break;
+    case 1:
+        echo 'Second case, which falls through';
+    case 2:
+    case 3:
+    case 4:
+        echo 'Third case, return instead of break';
+        return;
+    // Comment
+    default:
+        echo 'Default case';
+        break;
+}
\ No newline at end of file