Skip to content

Commit d29a90c

Browse files
author
Eric James Michael Ritz
committed
Merge pull request #222 from emestee/master
Add test case for issue #200
2 parents 89e1d88 + fcea8a8 commit d29a90c

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ In chronological order:
306306
64. l3msh0
307307
65. [Hernawan Fa'iz Abdillah](https://github.com/Abdillah)
308308
66. [Sebastian Wiesner](https://github.com/lunaryorn)
309-
309+
67. [Michael Stolovitzsky](https://github.com/emestee)
310310

311311

312312
[wiki]: https://github.com/ejmr/php-mode/wiki

php-mode-test.el

+7
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,13 @@ style from Drupal."
483483
(should-not (eq 'font-lock-type-face
484484
(get-text-property (point) 'face))))))
485485

486+
(ert-deftest php-mode-test-issue-200 ()
487+
"Test highlighting and elimination of extraneous whitespace in PSR-2 mode"
488+
(with-php-mode-test ("issue-200.php")
489+
(php-mode-custom-coding-style-set 'php-mode-coding-style 'psr2)
490+
(should show-trailing-whitespace)
491+
(should (and (listp before-save-hook) (member 'delete-trailing-whitespace before-save-hook)))))
492+
486493
(ert-deftest php-mode-test-issue-201 ()
487494
"Test highlighting of special variables"
488495
(with-php-mode-test ("issue-201.php")

tests/issue-200.php

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
/**
4+
* GitHub Issue: https://github.com/ejmr/php-mode/issues/200
5+
*
6+
* There are extra whitespaces in the code below. In PSR-2 mode, those must be
7+
* highlighted and stripped upon save (be careful when editing and saving,
8+
* then)
9+
*/
10+
11+
class Foo
12+
{
13+
public function test()
14+
{
15+
16+
}
17+
}
18+
19+

0 commit comments

Comments
 (0)