mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
Merge pull request #758 from faissaloux/feat/skip-on-os-family
skip os family
This commit is contained in:
@ -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');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user