Skip to content

Commit cfca8c4

Browse files
committed
2 parents bb51641 + 5799a4e commit cfca8c4

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

lua/neotest-phpunit/init.lua

+4
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ end
9696
---@param file_path string Absolute file path
9797
---@return neotest.Tree | nil
9898
function NeotestAdapter.discover_positions(path)
99+
if not NeotestAdapter.is_test_file(path) then
100+
return nil
101+
end
102+
99103
local query = [[
100104
((class_declaration
101105
name: (name) @namespace.name (#match? @namespace.name "Test")

lua/neotest-phpunit/utils.lua

+2-1
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,10 @@ local function make_outputs(test, output_file)
6060
local test_id = test_attr.file .. separator .. test_attr.line
6161
logger.info("PHPUnit id:", { test_id })
6262

63+
local classname = test_attr.classname or test_attr.class
6364
local test_output = {
6465
status = "passed",
65-
short = string.upper(test_attr.classname) .. "\n-> " .. "PASSED" .. " - " .. test_attr.name,
66+
short = string.upper(classname) .. "\n-> " .. "PASSED" .. " - " .. test_attr.name,
6667
output_file = output_file,
6768
}
6869

0 commit comments

Comments
 (0)