Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write blog about my-php-switch-to-test #7

Open
Fuco1 opened this issue May 2, 2017 · 3 comments
Open

Write blog about my-php-switch-to-test #7

Fuco1 opened this issue May 2, 2017 · 3 comments
Assignees
Labels
Projects

Comments

@Fuco1
Copy link
Owner

Fuco1 commented May 2, 2017

Especially the use of directory variables, that is soemthing people might find interesting.

@Fuco1 Fuco1 self-assigned this May 2, 2017
@Fuco1 Fuco1 added the blog label May 2, 2017
@Fuco1 Fuco1 added this to TODO in Blog May 2, 2017
@Fuco1
Copy link
Owner Author

Fuco1 commented May 15, 2017

Example local setup

((nil
  (flycheck-php-phpstan-executable . "/home/matus/dev/application/docker-phpstan")
  (flycheck-phpstan-level . "7")
  (my-get-compile-command
   .
   (lambda ()
     (let ((root (my-php-find-project-root))
           (dir (my-php-local-file-name (my-get-test-file))))
       (format "grunt --file='%s' test:php"
               (s-chop-prefix (concat root "/") (expand-file-name dir))))))
  (my-php-switch-to-test-function
   .
   (lambda (source)
     (let ((case-fold-search nil))
       (replace-regexp-in-string
        "/app/" "/tests/php/"
        (replace-regexp-in-string "\\.php\\'" ".phpt" source)))))
  (my-php-switch-to-source-function
   .
   (lambda (test)
     (let ((case-fold-search nil))
       (replace-regexp-in-string
        "/tests/php/" "/app/"
        (replace-regexp-in-string "\\.phpt\\'" ".php" test)))))))

@Fuco1
Copy link
Owner Author

Fuco1 commented Aug 17, 2017

Turns out this already exists inside Emacs as ff-find-other-file. So all we need is to provide appropriate setup for that library.

@Fuco1
Copy link
Owner Author

Fuco1 commented Feb 14, 2018

Wrote my own: https://github.com/Fuco1/find-test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Blog
TODO
Development

No branches or pull requests

1 participant