From 1c1cb1e591f5020c57724038fd8d44abe5413445 Mon Sep 17 00:00:00 2001 From: faissaloux Date: Fri, 31 Mar 2023 22:03:18 +0000 Subject: [PATCH] skip os family --- src/PendingCalls/TestCall.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/PendingCalls/TestCall.php b/src/PendingCalls/TestCall.php index 85a5848e..a178018c 100644 --- a/src/PendingCalls/TestCall.php +++ b/src/PendingCalls/TestCall.php @@ -172,15 +172,23 @@ final class TestCall return $this; } + /** + * Skips the current test if the given test is running on given os family. + */ + public function skipOsFamily(string $osFamily): self + { + return $this->skip( + PHP_OS_FAMILY === $osFamily, + "This test is skipped on $osFamily.", + ); + } + /** * 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'); } /**