Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ dev:
# for an example of using a script like this with the 'git bisect run'
# command.
test: clean all
touch tests/project/1/.git
$(EMACS) -Q -batch -L . -l tests/php-mode-test.el -f ert-run-tests-batch-and-exit

.PHONY: all autoloads clean test
10 changes: 8 additions & 2 deletions tests/php-mode-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ file name and check that the faces of the fonts in the buffer match."
`(with-temp-buffer
(setq php-mode-enable-backup-style-variables nil)
(insert-file-contents (expand-file-name ,file php-mode-test-dir))
(setq default-directory
(expand-file-name ".." (expand-file-name ,file php-mode-test-dir)))
(php-mode)
,(if (fboundp 'font-lock-ensure)
'(font-lock-ensure)
Expand Down Expand Up @@ -635,8 +637,12 @@ as a keyword."
(should (eq 0 (- (point-max) (point-min))))))

(ert-deftest php-project-root ()
(should (string= (abbreviate-file-name default-directory)
(php-project-get-root-dir))))
"Test for detection `php-project-root' by directory."
(dolist (root (mapcar #'car php-project-available-root-files))
(with-php-mode-test ("project/1/src/functions.php")
(let ((php-project-root root))
(should (string= (expand-file-name "project/1/" php-mode-test-dir)
(expand-file-name (php-project-get-root-dir))))))))

(defun php-mode-test-in-function-p (&optional pos)
"Determine whether POS is inside a function.
Expand Down
Empty file added tests/project/1/.editorconfig
Empty file.
Empty file added tests/project/1/.hg
Empty file.
Empty file added tests/project/1/.projectile
Empty file.
Empty file added tests/project/1/.svn
Empty file.
Empty file added tests/project/1/composer.json
Empty file.
1 change: 1 addition & 0 deletions tests/project/1/src/functions.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php