branch: externals/phps-mode
commit c5beb502970013a3fae4b5c4873d46641a6c02ee
Author: Christian Johansson <[email protected]>
Commit: Christian Johansson <[email protected]>
Added another unit test for indentation with special syntax
---
phps-test-functions.el | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/phps-test-functions.el b/phps-test-functions.el
index 523641f..064ec1b 100644
--- a/phps-test-functions.el
+++ b/phps-test-functions.el
@@ -162,6 +162,13 @@
(should (equal buffer-contents "<?php\nif (myFirstCondition()) {\n
$this->var = 'abc123';\n} else if (mySeconCondition()) {\n $this->var =
'def456';\n}\n"))))
(phps-mode/with-test-buffer
+ "<?php\nif (myRandomCondition()):\necho 'Something here';\n else:\n
echo 'Something else here';\nendif;\n"
+ (goto-char 60)
+ (phps-mode/indent-line)
+ (let ((buffer-contents (buffer-substring-no-properties (point-min)
(point-max))))
+ (should (equal buffer-contents "<?php\nif (myRandomCondition()):\necho
'Something here';\nelse:\n echo 'Something else here';\nendif;\n"))))
+
+ (phps-mode/with-test-buffer
"<?php\nif (myRandomCondition()):\necho 'Something here';\n echo
'Something else here';\nendif;\n"
(goto-char 40)
(phps-mode/indent-line)