Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can @group annotation be used on class level in phpunit

I am trying to explore the possibility of using @group or @author annotation on class level, so that I may assign some sort of ownership to specific people. Also, with this, I plan to macro-manage things, like: if I want one or more classes to run (in their entirety), I can just specify their groups as, say ABC and then use --groups option.

Presently, I think @groups or @author is used on test case level only, and not on Test Class level. What I think is that one class may have hundreds of test cases, and writing @author or @group would be very tedious. And in future, if the ownership changes, we need to change the annotation attribute everywhere. Hence, is there any way to specify @group or something like that on class level?

like image 812
Yo Yo Money Singh Avatar asked Sep 05 '14 08:09

Yo Yo Money Singh


1 Answers

Yes you can use @group on test classes. However I could not find it in the documentation so it can be something that will change. (I've checked it on PHPUnit v3.7.37)

Note: this is something that is fairly easy to try, I'd even say quicker than asking it here. Also typing "phpunit class level group annotation" into google yields a blog page about this as the first result.

like image 94
fejese Avatar answered Oct 07 '22 11:10

fejese