'Skip PHPUnit test classes on certain OSFAMILY using annotations

I would like to skip a PHPUnit test class on a specific operating system family (Windows) using annotations. (I want to include everything else: BSD, Darwin, Solaris, and Linux.) I see from the PHPUnit documentation that I can use @requires OSFAMILY to require a an OS family but not to exclude one. Unlike @requires OSFAMILY, @requires OS supports regex--which is better, but the list of specific operating systems is (obviously) much longer than families (and unspecified), leading to something ugly that I haven't figured out yet. Of course, I can use self::markTestSkipped() in the ::setUp() method, for example, but I prefer the brevity of an annotation. Is there a way to do this other than my ugly @requires OS regex?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source