Skip to content

Commit

Permalink
Allow overriding of AbstractRulesetTestCase::createRuleset()
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbalandan committed May 7, 2021
1 parent 31908e5 commit 405314a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this library will be documented in this file:
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [v3.0.2](https://github.com/NexusPHP/cs-config/compare/v3.0.1...v3.0.2) - 2021-05-07

- Allow overriding of `AbstractRulesetTestCase::createRuleset()`

## [v3.0.1](https://github.com/NexusPHP/cs-config/compare/v3.0.0...v3.0.1) - 2021-05-07

- Update branch alias to `3.x-dev`
Expand Down
8 changes: 4 additions & 4 deletions src/Test/AbstractRulesetTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,15 @@ final public function testRulesAreSortedByName(string $source, array $rules): vo

final public function testHeaderCommentFixerIsDisabledByDefault(): void
{
$rules = self::createRuleset()->getRules();
$rules = static::createRuleset()->getRules();

self::assertArrayHasKey('header_comment', $rules);
self::assertFalse($rules['header_comment']);
}

final public function testDeprecatedFixersAreNoLongerUsed(): void
{
$rules = array_keys(self::createRuleset()->getRules());
$rules = array_keys(static::createRuleset()->getRules());
$fixers = $this->deprecatedBuiltInFixers();

$rulesWithoutDeprecatedRules = array_filter(
Expand All @@ -108,13 +108,13 @@ static function (string $fixer) use ($fixers): bool {
self::assertEmpty($notRemovedDeprecatedRules, sprintf(
'Failed asserting that deprecated rules "%s" are removed from "%s" ruleset.',
implode('", "', $notRemovedDeprecatedRules),
self::createRuleset()->getName()
static::createRuleset()->getName()
));
}

final public function testRulesetDoesNotUseDeprecatedConfigurationOptions(): void
{
$ruleset = self::createRuleset();
$ruleset = static::createRuleset();

$rules = $ruleset->getRules();
$names = array_keys($rules);
Expand Down

0 comments on commit 405314a

Please sign in to comment.