0

I think this is an incompatibility between the @test command in Doxygen and php, but I am hoping someone can point me towards a workaround, which my googles skills have been unable to find.

The error can be reproduced by documenting the file:

<?php
namespace TestNamespace;

/** @test This is a test
 *
 *  @test This is a second test
 */
class TestClass { }

/** @test This is a test on another class
 */
class TestClass2 { }

When generating the documentation there are warnings:

test:2: warning: Illegal command TestClass as part of a \ref
test:4: warning: Illegal command TestClass2 as part of a \ref

The html page produced for TestClass and TestClass2 both show the proper tests. If, however, you navigate to the Test List page, the display names for the classes are incorrect, as can be seen in this screenshot:

Produced Test List Documentation

When clicking the TestNamespace links, the proper class page is navigated to, so it appears the only problems are the warnings printed to stderr during generation and the display name of the classes on the Test List page.

The only way I can think of to fix this is to stop using namespaces, at which point the cure is worse than the disease. I am hoping someone has run into this before and has a way to fix this behaviour. I am okay with using :: or as a namespace specifier in the documentation if necessary.

Godric Seer
  • 359
  • 4
  • 16
  • 1
    The problem is not with `@test` because the same thing happens if you change it to a `@todo` instead -- perhaps a more general parsing error. Personally I use PHPDoc so I can't give you much help beyond that! – miken32 Nov 13 '15 at 18:21
  • I have no solution, but you can take a look in my collection of [doxygen-php-filters](https://github.com/AbcAeffchen/doxygen-php-filters). Maybe you find something helpful. – AbcAeffchen Nov 13 '15 at 19:04

0 Answers0