Skip to content

Commit

Permalink
feat: #27 support attribute tests
Browse files Browse the repository at this point in the history
Thanks to @mimre25!
  • Loading branch information
olimorris committed May 5, 2024
1 parent 4d4b189 commit 360ec0d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lua/neotest-phpunit/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,18 @@ function NeotestAdapter.discover_positions(path)
name: (name) @namespace.name (#match? @namespace.name "Test")
)) @namespace.definition
((method_declaration
(attribute_list
(attribute_group
(attribute) @test_attribute (#match? @test_attribute "Test")
)
)
(
(visibility_modifier) @test.definition
(name) @test.name
)
))
((method_declaration
(name) @test.name (#match? @test.name "test")
)) @test.definition
Expand Down
13 changes: 13 additions & 0 deletions tests/Unit/AttributeTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;

class AttributeTest extends TestCase
{
#[Test]
public function it_should_pass_if_attributes_work()
{
$this->assertTrue(true);
}
}

0 comments on commit 360ec0d

Please sign in to comment.