-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Output formatting issue in PHPUnit with TestDox #5949
Comments
Thank you for your report. Please provide a minimal, self-contained, reproducing test case that shows the problem you are reporting. Without such a minimal, self-contained, reproducing test case I will not be able to investigate this issue. |
Hallo Sebastian and thanks for response. Due to the complexity of the framework I'm developing, isolating the issue into a minimal reproducible example is not straightforward. The problem is uniquely confined to the framework's test suite. I've investigated the problem and from the This is the code of the
As you can see, there is no line break and the tag, unlike what happens with the other methods, is closed immediately after the text. I can't tell you why this is happening. Thanks and Sorry. |
I investigate into the Issue 1: Extraneous Comma After In the render method of the While this extra comma does not produce a syntax error, it may introduce unintended behavior in some contexts, especially depending on the PHP version in use. It is a minor formatting issue but should be removed for better code clarity and to avoid any potential parsing confusion. Issue 2: Missing Newline After In the generated HTML output, there is a missing newline character (\n) after the closing tag for the last two list items. This inconsistency in formatting can be seen in the HTML output provided, where some tags are followed by a newline, but others are not. This can be fixed by adding an additional \n after each to ensure that the line breaks are consistent throughout the output. The updated code would look like this:
The second newline guarantees that even the final list items have a consistent format and include proper line breaks in the HTML structure. This makes the output easier to read and avoids any issues with missing line breaks in specific cases. I hope I have been helpful |
PHPUnit 11 is not supported on versions of PHP that do not support "extraneous" commas. Why would a missing newline after an |
To tell the truth, the idea came from the fact that I have already had similar experiences and in the end the problems were always of this type. |
I do not understand what you are trying to report as in #5949 (comment) you are showing TestDox text output and in #5949 (comment) you talk about TestDox HTML output. Please provide a minimal, self-contained, reproducing test case that shows the problem you are reporting. |
I am facing an output formatting problem in my PHPUnit tests when I employ TestDox. Specifically, the final test method in each class is consistently displayed with improper spacing or indentation. This occurs regardless of the method's location within the class. I have attempted to rearrange the methods and even created new test classes, but the issue remains.
I've observed that the problem seems to be connected to the utilization of the
#[Test]
and#[TestDox]
attributes, and the placement of comments within test methods. No matter how I position the attributes and comments, the last method is always formatted incorrectly.I am using PHPUnit version 11.3.4. My code editor is Nano/Visual Studio Code/PHPStorm, on Linux system.
The
phpunit.xml
file is:This Is my test class:
This Is the output.
It can be observed that there is no spacing between the title of the final method in the class and the descriptive text of the preceding method.
Thanks in advanced.
Adriano
The text was updated successfully, but these errors were encountered: