mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 15:57:21 +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;
|
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.',
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user