Skip to content

Commit d57587b

Browse files
committed
Fix indentation
1 parent d80a657 commit d57587b

File tree

1 file changed

+50
-52
lines changed

1 file changed

+50
-52
lines changed

php-mode-test.el

Lines changed: 50 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@
4343
(c-after-font-lock-init)
4444

4545
(defvar php-mode-test-dir (expand-file-name "tests"
46-
(if load-file-name
47-
(file-name-directory load-file-name)
48-
default-directory))
46+
(if load-file-name
47+
(file-name-directory load-file-name)
48+
default-directory))
4949
"Directory containing the `php-mode' test files.")
5050

5151
(defvar php-mode-test-valid-magics '(indent)
@@ -178,8 +178,8 @@ The next character after \">We\" is a single quote. It should not
178178
have a string face."
179179
:expected-result :failed
180180
(with-php-mode-test ("issue-9.php")
181-
(search-forward ">We")
182-
(forward-char) ;; Jump to after the opening apostrophe
181+
(search-forward ">We")
182+
(forward-char) ;; Jump to after the opening apostrophe
183183
(should-not (eq
184184
(get-text-property (point) 'face)
185185
'php-string))))
@@ -234,10 +234,10 @@ Gets the face of the text after the comma."
234234
This applies for both single and double quotes."
235235
(with-php-mode-test ("issue-21.php")
236236
(while (search-forward "#" nil t)
237-
(while (not (looking-at "\n"))
238-
(should (eq (get-text-property (point) 'face)
239-
'font-lock-comment-face))
240-
(forward-char)))))
237+
(while (not (looking-at "\n"))
238+
(should (eq (get-text-property (point) 'face)
239+
'font-lock-comment-face))
240+
(forward-char)))))
241241

242242
(ert-deftest php-mode-test-issue-27 ()
243243
"Indentation in a file with a shebang."
@@ -268,22 +268,22 @@ an error."
268268
(ert-deftest php-mode-test-issue-53 ()
269269
"Check if whitespace effects are undone when changing coding
270270
style from Drupal."
271-
(with-php-mode-test
272-
("issue-53.php")
273-
(search-forward "return $this->bar;")
274-
;; the file written to has no significance, only the buffer
275-
(let ((tmp-filename (concat (make-temp-name temporary-file-directory) ".php")))
276-
(dolist (mode '(pear wordpress symfony2))
277-
(php-set-style "drupal")
278-
(php-set-style (symbol-name mode))
279-
(should-not show-trailing-whitespace)
280-
(php-set-style "psr2")
281-
(php-set-style (symbol-name mode))
282-
(should-not show-trailing-whitespace)
283-
284-
(php-set-style "drupal")
285-
(write-file tmp-filename)
286-
(should (looking-at-p "$"))))))
271+
(with-php-mode-test ("issue-53.php")
272+
(search-forward "return $this->bar;")
273+
;; the file written to has no significance, only the buffer
274+
(let ((tmp-filename (concat (make-temp-name temporary-file-directory) ".php")))
275+
(dolist (mode '(pear wordpress symfony2))
276+
(php-set-style "drupal")
277+
(php-set-style (symbol-name mode))
278+
(should (eq nil show-trailing-whitespace))
279+
(php-set-style "psr2")
280+
(php-set-style (symbol-name mode))
281+
(should (eq nil show-trailing-whitespace))
282+
283+
(php-set-style "drupal")
284+
(write-file tmp-filename)
285+
(should (eq t show-trailing-whitespace))
286+
(should (looking-at-p "$"))))))
287287

288288
(ert-deftest php-mode-test-issue-73 ()
289289
"The `delete-indentation' function should work properly for PHP.
@@ -309,15 +309,14 @@ style from Drupal."
309309

310310
(ert-deftest php-mode-test-issue-83 ()
311311
"All static method should appear on imenu whether 'static' keyword is placed before or after visibility"
312-
(with-php-mode-test
313-
("issue-83.php")
314-
(let* ((index-alist (imenu--make-index-alist))
315-
(public-methods (mapcar 'car (cdr (assoc "Public Methods" index-alist))))
316-
(all-methods (mapcar 'car (cdr (assoc "All Methods" index-alist)))))
317-
(should (member "staticBeforeVisibility" public-methods))
318-
(should (member "staticBeforeVisibility" all-methods))
319-
(should (member "staticAfterVisibility" public-methods))
320-
(should (member "staticAfterVisibility" all-methods)))))
312+
(with-php-mode-test ("issue-83.php")
313+
(let* ((index-alist (imenu--make-index-alist))
314+
(public-methods (mapcar 'car (cdr (assoc "Public Methods" index-alist))))
315+
(all-methods (mapcar 'car (cdr (assoc "All Methods" index-alist)))))
316+
(should (member "staticBeforeVisibility" public-methods))
317+
(should (member "staticBeforeVisibility" all-methods))
318+
(should (member "staticAfterVisibility" public-methods))
319+
(should (member "staticAfterVisibility" all-methods)))))
321320

322321
(ert-deftest php-mode-test-issue-99 ()
323322
"Proper indentation for 'foreach' statements without braces."
@@ -340,14 +339,14 @@ style from Drupal."
340339
(ert-deftest php-mode-test-issue-124 ()
341340
"Proper syntax propertizing when a quote appears in a heredoc."
342341
(with-php-mode-test ("issue-124.php" :indent t)
343-
(search-forward "Start of heredoc")
344-
;; The heredoc should be recognized as a string.
345-
(dolist (syntax (c-guess-basic-syntax))
346-
(should (eq (car syntax) 'string)))
347-
(search-forward "function bar")
348-
;; After the heredoc should *not* be recognized as a string.
349-
(dolist (syntax (c-guess-basic-syntax))
350-
(should (not (eq (car syntax) 'string))))))
342+
(search-forward "Start of heredoc")
343+
;; The heredoc should be recognized as a string.
344+
(dolist (syntax (c-guess-basic-syntax))
345+
(should (eq (car syntax) 'string)))
346+
(search-forward "function bar")
347+
;; After the heredoc should *not* be recognized as a string.
348+
(dolist (syntax (c-guess-basic-syntax))
349+
(should (not (eq (car syntax) 'string))))))
351350

352351
(ert-deftest php-mode-test-issue-136 ()
353352
"Proper highlighting for variable interpolation."
@@ -964,16 +963,15 @@ Meant for `php-mode-test-issue-503'."
964963

965964
(ert-deftest php-mode-test-issue-503 ()
966965
"Function `php-beginning-of-defun' should return non-nil on success."
967-
(with-php-mode-test
968-
("issue-503.php")
969-
(php-mode)
970-
(goto-char (point-max))
971-
(should (eq (php-mode-test-in-function-p) nil))
972-
(should (eq (php-mode-test-in-function-p (1- (point))) t))
973-
(should (eq (php-mode-test-in-function-p 1) nil))
974-
(should (eq (php-mode-test-in-function-p 24) t))
975-
(goto-char (point-min))
976-
(should (eq (php-mode-test-in-function-p nil) nil))))
966+
(with-php-mode-test ("issue-503.php")
967+
(php-mode)
968+
(goto-char (point-max))
969+
(should (eq (php-mode-test-in-function-p) nil))
970+
(should (eq (php-mode-test-in-function-p (1- (point))) t))
971+
(should (eq (php-mode-test-in-function-p 1) nil))
972+
(should (eq (php-mode-test-in-function-p 24) t))
973+
(goto-char (point-min))
974+
(should (eq (php-mode-test-in-function-p nil) nil))))
977975

978976
(ert-deftest php-mode-test-php74-arrow-fn ()
979977
"Test highlighting arrow funcsion (short closure syntax) added in PHP 7.4."

0 commit comments

Comments
 (0)