Merge pull request #758 from faissaloux/feat/skip-on-os-family

skip os family
This commit is contained in:
Nuno Maduro
2023-03-31 23:27:51 +01:00
committed by GitHub

View File

@ -172,15 +172,28 @@ final class TestCall
return $this; 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. * Skips the current test if the given test is running on Windows.
*/ */
public function skipOnWindows(): self public function skipOnWindows(): self
{ {
return $this->skip( return $this->skipOsFamily('Windows');
PHP_OS_FAMILY === 'Windows',
'This test is skipped on Windows.',
);
} }
/** /**