|
| 1 | +<?php |
| 2 | +/** |
| 3 | + * Test the Ruleset::expandRulesetReference() method. |
| 4 | + * |
| 5 | + * @author Juliette Reinders Folmer <phpcs_nospam@adviesenzo.nl> |
| 6 | + * @copyright 2024 PHPCSStandards and contributors |
| 7 | + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence |
| 8 | + */ |
| 9 | + |
| 10 | +namespace PHP_CodeSniffer\Tests\Core\Ruleset; |
| 11 | + |
| 12 | +use PHP_CodeSniffer\Ruleset; |
| 13 | +use PHP_CodeSniffer\Tests\ConfigDouble; |
| 14 | +use PHP_CodeSniffer\Tests\Core\Ruleset\AbstractRulesetTestCase; |
| 15 | + |
| 16 | +/** |
| 17 | + * Test various aspects of the Ruleset::expandRulesetReference() method not covered by other tests. |
| 18 | + * |
| 19 | + * @covers \PHP_CodeSniffer\Ruleset::expandRulesetReference |
| 20 | + */ |
| 21 | +final class ExpandRulesetReferenceTest extends AbstractRulesetTestCase |
| 22 | +{ |
| 23 | + |
| 24 | + /** |
| 25 | + * The Ruleset object. |
| 26 | + * |
| 27 | + * @var \PHP_CodeSniffer\Ruleset |
| 28 | + */ |
| 29 | + private static $ruleset; |
| 30 | + |
| 31 | + |
| 32 | + /** |
| 33 | + * Initialize the config and ruleset objects for this test only once (but do allow recording code coverage). |
| 34 | + * |
| 35 | + * @xxbefore |
| 36 | + * |
| 37 | + * @return void |
| 38 | + */ |
| 39 | + protected function initializeConfigAndRuleset() |
| 40 | + { |
| 41 | + // @phpstan-ignore isset.property, identical.alwaysFalse |
| 42 | + if (isset(self::$ruleset) === false) { |
| 43 | + // Set up the ruleset. |
| 44 | + $standard = __DIR__."/ExpandRulesetReferenceTest.xml"; |
| 45 | + $config = new ConfigDouble(["--standard=$standard"]); |
| 46 | + self::$ruleset = new Ruleset($config); |
| 47 | + } |
| 48 | + |
| 49 | + }//end initializeConfigAndRuleset() |
| 50 | + |
| 51 | + |
| 52 | + public function testEverythingElse() |
| 53 | + { |
| 54 | + // Set up the ruleset. |
| 55 | + $standard = __DIR__."/ExpandRulesetReferenceTest.xml"; |
| 56 | + $config = new ConfigDouble(["--standard=$standard"]); |
| 57 | + $ruleset = new Ruleset($config); |
| 58 | + } |
| 59 | + |
| 60 | +}//end class |
0 commit comments