diff --git a/src/PendingCalls/TestCall.php b/src/PendingCalls/TestCall.php index 85a5848e..0b6139d6 100644 --- a/src/PendingCalls/TestCall.php +++ b/src/PendingCalls/TestCall.php @@ -172,15 +172,28 @@ final class TestCall return $this; } + /** + * Skips the current test if the given test is running on given os family. + */ + public function skipOsFamily(string ...$osFamilies): self + { + foreach ($osFamilies as $osFamily) { + if (PHP_OS_FAMILY === $osFamily) { + return $this->skip( + "This test is skipped on $osFamily.", + ); + } + } + + return $this; + } + /** * Skips the current test if the given test is running on Windows. */ public function skipOnWindows(): self { - return $this->skip( - PHP_OS_FAMILY === 'Windows', - 'This test is skipped on Windows.', - ); + return $this->skipOsFamily('Windows'); } /**