REDROOM
PHP 8.3.31
Path:
Logout
Edit File
Size: 2.60 KB
Close
/proc/self/root/opt/cpanel/ea-wappspector/vendor/squizlabs/php_codesniffer/tests/Core/Config/AbstractRealConfigTestCase.php
Text
Base64
<?php /** * Test case with helper methods for tests which need to use the *real* Config class (instead of the ConfigDouble). * * This test case should be used sparingly and only when it cannot be avoided. * * @copyright 2025 PHPCSStandards and contributors * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/HEAD/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Tests\Core\Config; use PHPUnit\Framework\TestCase; use ReflectionProperty; abstract class AbstractRealConfigTestCase extends TestCase { /** * Set static properties in the Config class to prevent tests influencing each other. * * @before * * @return void */ protected function setConfigStatics() { // Set to the property's default value to clear out potentially set values from other tests. self::setStaticConfigProperty('overriddenDefaults', []); self::setStaticConfigProperty('executablePaths', []); // Set to values which prevent the test-runner user's `CodeSniffer.conf` file // from being read and influencing the tests. self::setStaticConfigProperty('configData', []); self::setStaticConfigProperty('configDataFile', ''); }//end setConfigStatics() /** * Clean up after each finished test. * * @after * * @return void */ protected function clearArgv() { $_SERVER['argv'] = []; }//end clearArgv() /** * Reset the static properties in the Config class to their true defaults to prevent this class * from influencing other tests. * * @afterClass * * @return void */ public static function resetConfigToDefaults() { self::setStaticConfigProperty('overriddenDefaults', []); self::setStaticConfigProperty('executablePaths', []); self::setStaticConfigProperty('configData', null); self::setStaticConfigProperty('configDataFile', null); $_SERVER['argv'] = []; }//end resetConfigToDefaults() /** * Helper function to set a static property on the Config class. * * @param string $name The name of the property to set. * @param mixed $value The value to set the property to. * * @return void */ protected static function setStaticConfigProperty($name, $value) { $property = new ReflectionProperty('PHP_CodeSniffer\Config', $name); (PHP_VERSION_ID < 80100) && $property->setAccessible(true); $property->setValue(null, $value); (PHP_VERSION_ID < 80100) && $property->setAccessible(false); }//end setStaticConfigProperty() }//end class
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 6
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
AbstractRealConfigTestCase.php
2.60 KB
lrw-r--r--
2025-11-04 16:30:35
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ExtensionsArgTest.php
4.18 KB
lrw-r--r--
2025-11-04 16:30:35
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
GeneratorArgTest.php
4.45 KB
lrw-r--r--
2025-11-04 16:30:35
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ReportArgsTest.php
1.81 KB
lrw-r--r--
2025-11-04 16:30:35
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ReportWidthTest.php
8.23 KB
lrw-r--r--
2025-11-04 16:30:35
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
SniffsExcludeArgsTest.php
11.25 KB
lrw-r--r--
2025-11-04 16:30:35
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).