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

php: Add runnable tests #11514

Merged
merged 20 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
6d5115d
Add missing keyword mapping for `yield`
RemcoSmitsDev May 7, 2024
fb882a4
Add runnables query + task for running phpunit tests
RemcoSmitsDev May 7, 2024
c83b74e
Rename php to phpunit
RemcoSmitsDev May 8, 2024
74ea4de
Add support for @test annotation
RemcoSmitsDev May 8, 2024
775e21f
Make regex more strict
RemcoSmitsDev May 8, 2024
b4f737d
Fix render error for multiple targets
RemcoSmitsDev May 8, 2024
a886047
Fix don't match any annotation that starts with @test
RemcoSmitsDev May 8, 2024
eaa7d3d
Add `describe`, `it` and `test` function call expression to PHP outli…
RemcoSmitsDev May 8, 2024
0dcd096
Fix script was not run in correct location
RemcoSmitsDev May 8, 2024
7c3d96c
Fix only run test with the symbol name inside the current file
RemcoSmitsDev May 8, 2024
69b8bc3
Add support for pest runnable
RemcoSmitsDev May 8, 2024
37ac6a5
Allow multiple chainable methods for Pest runnable
RemcoSmitsDev May 8, 2024
0ef36ff
Modify outline scheme for Pest runnable chainable methods
RemcoSmitsDev May 8, 2024
ec94222
Clean up runnable queries
RemcoSmitsDev May 8, 2024
ef2b3ee
Move Pest runnable query/scheme to single statement
RemcoSmitsDev May 8, 2024
41b304c
Add support for PHPUnit #[Test] attributes
RemcoSmitsDev May 9, 2024
2fac4f8
Add _ to all not needed captures
RemcoSmitsDev May 9, 2024
53b83bc
Fix filter for names with spaces
RemcoSmitsDev May 9, 2024
ea831c2
Pest: Only match first argument
RemcoSmitsDev May 9, 2024
ffd0c6b
Add task for executing selection
RemcoSmitsDev May 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions extensions/php/languages/php/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,4 @@
"try" @keyword
"use" @keyword
"while" @keyword
"yield" @keyword
31 changes: 31 additions & 0 deletions extensions/php/languages/php/runnables.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
(
; Class that follow the naming convention of PHPUnit test classes
; and that doesn't have the abstract modifier
; and have a method that follow the naming convention of PHPUnit test methods
; and the method is public
(class_declaration
modifier: (_)? @modifier
(#not-eq? @modifier "abstract")
name: (_) @name
(#match? @name ".*Test")
body: (declaration_list
(method_declaration
(visibility_modifier)? @visibility
(#eq? @visibility "public")
name: (_) @run
(#match? @run "test.*")
)
)
)
) @php-test
RemcoSmitsDev marked this conversation as resolved.
Show resolved Hide resolved

; Class that follow the naming convention of PHPUnit test classes
; and that doesn't have the abstract modifier
(
(class_declaration
modifier: (_)? @modifier
(#not-eq? @modifier "abstract")
name: (_) @run
(#match? @run ".*Test")
)
) @php-test
8 changes: 8 additions & 0 deletions extensions/php/languages/php/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[
{
"label": "php test $ZED_SYMBOL",
"command": "vendor/bin/phpunit",
"args": ["--filter=$ZED_SYMBOL"],
"tags": ["php-test"]
RemcoSmitsDev marked this conversation as resolved.
Show resolved Hide resolved
}
]