branch: externals/phps-mode commit c80aa68ea3a5a97813b72f941673a72100cd0c78 Author: Christian Johansson <christ...@cvj.se> Commit: Christian Johansson <christ...@cvj.se>
Added a new failing test for indentation of else expression inside switch --- phps-mode-test-functions.el | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/phps-mode-test-functions.el b/phps-mode-test-functions.el index 470a686..471e512 100644 --- a/phps-mode-test-functions.el +++ b/phps-mode-test-functions.el @@ -203,6 +203,11 @@ (should (equal '((1 (0 0)) (2 (0 0)) (3 (1 0)) (4 (2 0)) (5 (1 0)) (6 (0 0))) (phps-mode-test-hash-to-list (phps-mode-functions-get-lines-indent))))) (phps-mode-test-with-buffer + "<?php\nswitch ($condition) {\n case 34:\n if ($item['Random'] % 10 == 0) {\n $attributes['item'] = ($item['IntegerValue'] / 10);\n } else {\n $attributes['item'] =\n number_format(($item['IntegerValue'] / 10), 1, '.', '');\n }\n break;\n}\n" + "Switch case with conditional modulo expression" + (should (equal '((1 (0 0)) (2 (0 0)) (3 (1 0)) (4 (2 0)) (5 (3 0)) (6 (2 0)) (7 (3 0)) (8 (4 0)) (9 (3 0)) (10 (3 0)) (11 (0 0))) (phps-mode-test-hash-to-list (phps-mode-functions-get-lines-indent))))) + + (phps-mode-test-with-buffer "<?php\n$options = array(\n 'options' => array(array(\n 'errorTo'\n ))\n);" "Assignment with three-dimensional array with double arrow assignment" (should (equal '((1 (0 0)) (2 (0 0)) (3 (1 0)) (4 (2 0)) (5 (1 0)) (6 (0 0))) (phps-mode-test-hash-to-list (phps-mode-functions-get-lines-indent))))) @@ -847,16 +852,6 @@ (should (equal buffer-contents "<?php\nnamespace myNamespace;\nclass myClass extends myAbstract implements myInterface {\n public function myFunctionA($myArg = null) {}\n protected function myFunctionB($myArg = 'abc') {}\n}\n")))) ) -;; TODO Add test for this: - ;; case 34: - ;; if ($item['IntegerValue'] % 10 == 0) { - ;; $attributes['boat']['Effekt (hk)'] = ($item['IntegerValue'] / 10); - ;; } else { - ;; $attributes['boat']['Effekt (hk)'] = - ;; number_format(($item['IntegerValue'] / 10), 1, '.', ''); - ;; } - ;; break; - (defun phps-mode-test-functions () "Run test for functions."