From ab4787c66749ed935eca0baedd6aa34b163fd21c Mon Sep 17 00:00:00 2001 From: Vincenzo Petrucci Date: Fri, 17 Nov 2023 15:03:28 +0100 Subject: [PATCH] feat: added onlyOn* methods to run the test only on a specific OS --- src/PendingCalls/TestCall.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/PendingCalls/TestCall.php b/src/PendingCalls/TestCall.php index 60b6fcf8..102a4f17 100644 --- a/src/PendingCalls/TestCall.php +++ b/src/PendingCalls/TestCall.php @@ -223,6 +223,30 @@ final class TestCall return $this->skipOn('Linux', 'This test is skipped on [Linux].'); } + /** + * Runs the current test only if the given test is running on Windows. + */ + public function onlyOnWindows(): self + { + return $this->skipOnLinux()->skipOnMac(); + } + + /** + * Runs the current test only if the given test is running on Mac. + */ + public function onlyOnMac(): self + { + return $this->skipOnWindows()->skipOnLinux(); + } + + /** + * Run the current test only if the given test is running on Linux. + */ + public function onlyOnLinux(): self + { + return $this->skipOnWindows()->skipOnMac(); + } + /** * Skips the current test if the given test is running on the given operating systems. */