Following your guide about Unit Testing I was able to generate a unit test project (PHP Console project).

I've added this as a new project to a solution with multiple other PHP and C# projects as well as other C# Unit Test projects.

Unfortunately the VS Test Explorer only recognizes the C# Unit Test projects but shows no tests from the PHP Unit Test project.

I've then created a blank VS Solution file and added my existing PHP Unit Test project to the new blank VS Solution.

To my surprise, in this Solution the VS Test Explorer correctly recognizes my PHP Unit Tests.

So my assumption would be that it is not possible to have PHP Unit Tests in a solution with other non-PHP Unit Tests and/or other non-PHP projects.

My question

Could you please give me a hint whether I'm making something wrong here?

    UweKeim they should work in multi-project solution the same way.

    We're looking for all phpunit.xml(.dist) files, ignoring those in vendor. Then we have to resolve test directories specified in phpunit.xml and parse test files ..

    I'll do more testing, if we haven't missed anything. Eventually we might add more logging.

    Thanks, Jakub, currently my SLN consists of:

    • Two .NET 7 WPF projects
    • Three .NET 7 Console application projects
    • One PHP web application project (without Unit Tests)
    • One ASP.NET Core 7 WASM Blazor project
    • One .NET 7 Class library project
    • One PHP Unit Test project
    • One .NET 7 XUnit Unit Test project

    Maybe this could help in further investigating.

      UweKeim thanks, that should work. We don't actually make it any different with one or more other projects in the solution.

      I'll try that.

      Mostly, the issue is the wrong relative test directory specified in phpunit.xml file.

      Write a Reply...