Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / nikic / php-parser / test / code / formatPreservation / listRemoval.test
diff --git a/vendor/nikic/php-parser/test/code/formatPreservation/listRemoval.test b/vendor/nikic/php-parser/test/code/formatPreservation/listRemoval.test
new file mode 100644 (file)
index 0000000..0ac4239
--- /dev/null
@@ -0,0 +1,41 @@
+Removing from list nodes
+-----
+<?php $foo; $bar; $baz;
+-----
+array_splice($stmts, 1, 1, []);
+-----
+<?php $foo; $baz;
+-----
+<?php
+function foo(
+    $a,
+    $b,
+    $c
+) {}
+-----
+array_pop($stmts[0]->params);
+-----
+<?php
+function foo(
+    $a,
+    $b
+) {}
+-----
+<?php
+function foo(
+    $a,
+    $b,
+    $c
+) {}
+-----
+array_pop($stmts[0]->params);
+$stmts[0]->params[] = new Node\Param(new Expr\Variable('x'));
+$stmts[0]->params[] = new Node\Param(new Expr\Variable('y'));
+-----
+<?php
+function foo(
+    $a,
+    $b,
+    $x,
+    $y
+) {}
\ No newline at end of file