Skip to content

Commit

Permalink
feat: onlyOn* methods, removed private onlyOn, rely instead on skipOn…
Browse files Browse the repository at this point in the history
…* methods
  • Loading branch information
nahime0 committed Nov 20, 2023
1 parent cf23dfa commit f7705fe
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions src/PendingCalls/TestCall.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,33 +238,23 @@ private function skipOn(string $osFamily, string $message): self
*/
public function onlyOnWindows(): self
{
return $this->onlyOn('Windows', 'This test is skipped unless on [Windows].');
return $this->skipOnMac()->skipOnLinux();
}

/**
* Skips the current test unless the given test is running on Mac.
*/
public function onlyOnMac(): self
{
return $this->onlyOn('Darwin', 'This test is skipped unless on [Mac].');
return $this->skipOnWindows()->skipOnLinux();
}

/**
* Skips the current test unless the given test is running on Linux.
*/
public function onlyOnLinux(): self
{
return $this->onlyOn('Linux', 'This test is skipped unless on [Linux].');
}

/**
* Skips the current test unless the given test is running on the given operating system.
*/
private function onlyOn(string $osFamily, string $message): self
{
return $osFamily !== PHP_OS_FAMILY
? $this->skip($message)
: $this;
return $this->skipOnWindows()->skipOnMac();
}

/**
Expand Down

0 comments on commit f7705fe

Please sign in to comment.