File tree Expand file tree Collapse file tree 8 files changed +10
-2
lines changed Expand file tree Collapse file tree 8 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 3737# for an example of using a script like this with the 'git bisect run'
3838# command.
3939test : clean all
40+ touch tests/project/1/.git
4041 $(EMACS ) -Q -batch -L . -l tests/php-mode-test.el -f ert-run-tests-batch-and-exit
4142
4243.PHONY : all autoloads clean test
Original file line number Diff line number Diff line change @@ -134,6 +134,8 @@ file name and check that the faces of the fonts in the buffer match."
134134 `(with-temp-buffer
135135 (setq php-mode-enable-backup-style-variables nil )
136136 (insert-file-contents (expand-file-name , file php-mode-test-dir))
137+ (setq default-directory
138+ (expand-file-name " .." (expand-file-name , file php-mode-test-dir)))
137139 (php-mode)
138140 ,(if (fboundp 'font-lock-ensure )
139141 '(font-lock-ensure )
@@ -635,8 +637,12 @@ as a keyword."
635637 (should (eq 0 (- (point-max ) (point-min ))))))
636638
637639(ert-deftest php-project-root ()
638- (should (string= (abbreviate-file-name default-directory)
639- (php-project-get-root-dir))))
640+ " Test for detection `php-project-root' by directory."
641+ (dolist (root (mapcar #'car php-project-available-root-files))
642+ (with-php-mode-test (" project/1/src/functions.php" )
643+ (let ((php-project-root root))
644+ (should (string= (expand-file-name " project/1/" php-mode-test-dir)
645+ (expand-file-name (php-project-get-root-dir))))))))
640646
641647(defun php-mode-test-in-function-p (&optional pos )
642648 " Determine whether POS is inside a function.
Original file line number Diff line number Diff line change 1+ <?php
You can’t perform that action at this time.
0 commit comments