Security update for Core, with self-updated composer
[yaffs-website] / vendor / nikic / php-parser / test / code / prettyPrinter / expr / yield.test
diff --git a/vendor/nikic/php-parser/test/code/prettyPrinter/expr/yield.test b/vendor/nikic/php-parser/test/code/prettyPrinter/expr/yield.test
new file mode 100644 (file)
index 0000000..12ab7de
--- /dev/null
@@ -0,0 +1,46 @@
+Yield
+-----
+<?php
+
+function gen()
+{
+    yield;
+    yield $a;
+    yield $a => $b;
+    $a = yield;
+    $a = (yield $b);
+    $a = (yield $b => $c);
+}
+// TODO Get rid of parens for cases 2 and 3
+-----
+function gen()
+{
+    yield;
+    (yield $a);
+    (yield $a => $b);
+    $a = yield;
+    $a = (yield $b);
+    $a = (yield $b => $c);
+}
+// TODO Get rid of parens for cases 2 and 3
+-----
+<?php
+
+function gen()
+{
+    $a = yield $b;
+    $a = yield $b => $c;
+    yield from $a;
+    $a = yield from $b;
+}
+// TODO Get rid of parens for last case
+-----
+!!php7
+function gen()
+{
+    $a = (yield $b);
+    $a = (yield $b => $c);
+    yield from $a;
+    $a = (yield from $b);
+}
+// TODO Get rid of parens for last case
\ No newline at end of file