Skip to content

Commit

Permalink
Add explicit skip for empty parse/serialize test rulesets
Browse files Browse the repository at this point in the history
  • Loading branch information
gapple committed Jan 16, 2023
1 parent f63dfaa commit 5af4c53
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions tests/RulesetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,22 +80,34 @@ protected function rulesetDataProvider(): array

public function parseRulesetDataProvider(): array
{
return array_filter(
$tests = array_filter(
static::rulesetDataProvider(),
function ($params) {
return !empty($params[0]->raw);
}
);

if (empty($tests)) {
$this->markTestSkipped("No parse rules");
}

return $tests;
}

public function serializeRulesetDataProvider(): array
{
return array_filter(
$tests = array_filter(
static::rulesetDataProvider(),
function ($params) {
return !empty($params[0]->expected);
}
);

if (empty($tests)) {
$this->markTestSkipped("No serialize rules");
}

return $tests;
}

/**
Expand Down

0 comments on commit 5af4c53

Please sign in to comment.