@@ -80,6 +80,7 @@ the coding style to one of the following:
80
80
2. `drupal'
81
81
3. `wordpress'
82
82
4. `symfony2'
83
+ 5. `psr2'
83
84
84
85
Using any other symbol for STYLE results in undefined behavior.
85
86
The test will use the PHP style by default.
@@ -97,6 +98,7 @@ run with specific customizations set."
97
98
(drupal '(php-enable-drupal-coding-style))
98
99
(wordpress '(php-enable-wordpress-coding-style))
99
100
(symfony2 '(php-enable-symfony2-coding-style))
101
+ (psr2 '(php-enable-psr2-coding-style))
100
102
(t '(php-enable-default-coding-style)))
101
103
102
104
,(unless custom '(custom-set-variables '(php-lineup-cascaded-calls nil )))
@@ -474,7 +476,6 @@ style from Drupal."
474
476
" Indentation of switch case body preceeded by multiple case statements"
475
477
(with-php-mode-test (" issue-186.php" :indent t :magic t )))
476
478
477
-
478
479
(ert-deftest php-mode-test-issue-197 ()
479
480
" Test highlighting of member and function names (should not have type face)"
480
481
(with-php-mode-test (" issue-197.php" )
@@ -535,4 +536,19 @@ style from Drupal."
535
536
(php-cautious-indent-line)
536
537
(should (= (current-indentation ) c-basic-offset))))
537
538
539
+ (ert-deftest php-mode-test-switch-statements()
540
+ " Test indentation inside switch statements"
541
+ (with-php-mode-test (" switch-statements.php" :indent t :style pear)
542
+ (search-forward " case true:" )
543
+ (should (eq (current-indentation ) 0 ))
544
+ (search-forward " break" )
545
+ (should (eq (current-indentation ) c-basic-offset)))
546
+ (with-php-mode-test (" switch-statements.php" :indent t :style psr2)
547
+ (search-forward " case true:" )
548
+ (should (eq (current-indentation ) c-basic-offset))
549
+ (search-forward " break" )
550
+ (should (eq (current-indentation ) (* 2 c-basic-offset)))
551
+ (search-forward " return" )
552
+ (should (eq (current-indentation ) (* 2 c-basic-offset)))))
553
+
538
554
; ;; php-mode-test.el ends here
0 commit comments