branch: externals/phps-mode
commit 7ec071188a851c1993bcb17caa938ddd6a29ff5a
Author: Christian Johansson <[email protected]>
Commit: Christian Johansson <[email protected]>
Added more indent unit tests for nested function calls
---
test/phps-mode-test-indent.el | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/test/phps-mode-test-indent.el b/test/phps-mode-test-indent.el
index ed7c8d3e9f..83a6f473ae 100644
--- a/test/phps-mode-test-indent.el
+++ b/test/phps-mode-test-indent.el
@@ -276,14 +276,30 @@
"<?php\n$var = [\n 1,\n 2,\n 3\n];\n"
"Square bracket array definition in assignment")
+ (phps-mode-test-indent--should-equal
+ "<?php\n[\n 1,\n [\n 2,\n [\n 3,\n
4\n ]\n ],\n [\n 5,\n 6,\n ],\n 7,\n];\n"
+ "Multi-dimensional square bracket array definition")
+
(phps-mode-test-indent--should-equal
"<?php\n$var = [\n 1,\n [\n 2,\n [\n 3,\n
4\n ]\n ],\n [\n 5,\n 6,\n ],\n
7,\n];\n"
"Multi-dimensional square bracket array definition in assignment")
+ (phps-mode-test-indent--should-equal
+ "<?php\narray(\n 1,\n array(\n 2,\n array(\n
3,\n 4\n )\n ),\n array(\n 5,\n 6,\n
),\n 7,\n);\n"
+ "Multi-dimensional round bracket array definition")
+
(phps-mode-test-indent--should-equal
"<?php\n$var = array(\n 1,\n array(\n 2,\n array(\n
3,\n 4\n )\n ),\n array(\n 5,\n
6,\n ),\n 7,\n);\n"
"Multi-dimensional round bracket array definition in assignment")
+ (phps-mode-test-indent--should-equal
+ "<?php\nmyFunctionA(\n 1,\n myFunctionB(\n 2,\n
myFunctionC(\n 3,\n 4\n )\n ),\n
myFunctionD(\n 5,\n 6\n ),\n 7\n);\n"
+ "Multi-dimensional function calls")
+
+ (phps-mode-test-indent--should-equal
+ "<?php\n$var = myFunctionA(\n 1,\n myFunctionB(\n 2,\n
myFunctionC(\n 3,\n 4\n )\n ),\n
myFunctionD(\n 5,\n 6\n ),\n 7\n);\n"
+ "Multi-dimensional function calls in assignment")
+
(phps-mode-test-indent--should-equal
"<?php\n/** @define string _PRIVATE_ROOT_ Absolute root to
private */\ndefine('_PRIVATE_ROOT_',\n
dirname($parameters[self::PARAMETER_SITE_PATH]) . DIRECTORY_SEPARATOR);\n"
"Mutiline define statement")