'checkSkippedTests', ]; public function checkSkippedTests(FailEvent $event) { $branch = getenv('CIRCLE_BRANCH'); $testName = $event->getTest()->getMetadata()->getName(); // list of tests that are allowed to be skipped on trunk and release branches $allowedToSkipList = ['createSubscriptionSegmentForActiveSubscriptions']; if (in_array($branch, ['trunk', 'release']) && !in_array($testName, $allowedToSkipList)) { throw new \PHPUnit\Framework\ExpectationFailedException("Failed, Cannot skip tests on branch $branch."); } } }