From 13d38d77b8ec74456e30dd51a9823977bc0f2fde Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Wed, 16 Apr 2025 12:31:24 -0700 Subject: oni-php: Add auto-insert template for Laravel test files --- oni-php/oni-php.el | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'oni-php') diff --git a/oni-php/oni-php.el b/oni-php/oni-php.el index 36394da..22e3ef5 100644 --- a/oni-php/oni-php.el +++ b/oni-php/oni-php.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse ;; Keywords: local -;; Version: 2025.0407.141956 +;; Version: 2025.0415.154414 ;; Package-Requires: (php-mode oni-yasnippet oni-flycheck oni-company oni-hydra oni-smartparens ggtags fic-mode company-php rainbow-delimiters) ;; This program is free software; you can redistribute it and/or modify @@ -205,5 +205,30 @@ Otherwise call FUNC with ARGS. This is meant as advice around (with-eval-after-load 'grep (add-to-list 'grep-files-aliases '("php" . "*.php *.inc *.module"))) +(with-eval-after-load 'autoinsert + (setf (map-elt auto-insert-alist (rx "Test.php" eos)) + '(nil + " "use RefreshDatabase;\n" + > "use WithFaker;\n" + "\n" + > "/** @test */\n" + > "public function " (replace-regexp-in-string (rx whitespace) "_" (downcase (skeleton-read "Test function name: "))) "(): void\n" + "{" > "\n" + > _ "\n" + "}" > "\n" + "}"))) + (provide 'oni-php) ;;; oni-php.el ends here -- cgit v1.3-2-g0d8e