-
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<?php | ||
/** | ||
* Test the Ruleset::expandRulesetReference() method. | ||
* | ||
* @author Juliette Reinders Folmer <[email protected]> | ||
* @copyright 2024 PHPCSStandards and contributors | ||
* @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence | ||
*/ | ||
|
||
namespace PHP_CodeSniffer\Tests\Core\Ruleset; | ||
|
||
use PHP_CodeSniffer\Ruleset; | ||
use PHP_CodeSniffer\Tests\ConfigDouble; | ||
use PHP_CodeSniffer\Tests\Core\Ruleset\AbstractRulesetTestCase; | ||
|
||
/** | ||
* Test various aspects of the Ruleset::expandRulesetReference() method not covered by other tests. | ||
* | ||
* @covers \PHP_CodeSniffer\Ruleset::expandRulesetReference | ||
*/ | ||
final class ExpandRulesetReferenceTest extends AbstractRulesetTestCase | ||
{ | ||
|
||
/** | ||
* The Ruleset object. | ||
* | ||
* @var \PHP_CodeSniffer\Ruleset | ||
*/ | ||
private static $ruleset; | ||
|
||
|
||
/** | ||
* Initialize the config and ruleset objects for this test only once (but do allow recording code coverage). | ||
* | ||
* @xxbefore | ||
* | ||
* @return void | ||
*/ | ||
protected function initializeConfigAndRuleset() | ||
{ | ||
// @phpstan-ignore isset.property, identical.alwaysFalse | ||
if (isset(self::$ruleset) === false) { | ||
// Set up the ruleset. | ||
$standard = __DIR__."/ExpandRulesetReferenceTest.xml"; | ||
$config = new ConfigDouble(["--standard=$standard"]); | ||
self::$ruleset = new Ruleset($config); | ||
} | ||
|
||
}//end initializeConfigAndRuleset() | ||
|
||
|
||
public function testEverythingElse() | ||
{ | ||
// Set up the ruleset. | ||
$standard = __DIR__."/ExpandRulesetReferenceTest.xml"; | ||
$config = new ConfigDouble(["--standard=$standard"]); | ||
$ruleset = new Ruleset($config); | ||
} | ||
|
||
}//end class |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0"?> | ||
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="ExpandRulesetReferenceTest" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/PHPCSStandards/PHP_CodeSniffer/master/phpcs.xsd"> | ||
|
||
<!-- LINE 993-994 ?? test ONLINE Including a category of sniffs via a ruleset relative directory ref. --> | ||
<rule ref="./fixtures/teststandard/sniffs/validsniffs"/> | ||
|
||
</ruleset> |