ReportWidthTest
extends TestCase
in package
Tests for the \PHP_CodeSniffer\Config reportWidth value.
Tags
Table of Contents
Methods
- cleanConfig() : void
- Set static properties in the Config class to prevent tests influencing each other.
- dataReportWidthInputHandling() : array<string, array<string, mixed>>
- Data provider.
- resetConfig() : void
- Clean up after each finished test.
- resetConfigToDefaults() : void
- Reset the static properties in the Config class to their true defaults to prevent this class from influencing other tests.
- setStaticProperty() : void
- Helper function to set a static property on the Config class.
- testReportWidthCanBeSetFromCLI() : void
- Test that the report width will be set correctly when passed as a CLI argument.
- testReportWidthCanBeSetFromConfFile() : void
- Test that the report width will be set correctly when found in the CodeSniffer.conf file.
- testReportWidthDefault() : void
- Test that report width without overrules will always be set to a non-0 positive integer.
- testReportWidthInputHandling() : void
- Test that the report width will be set correctly for various types of input.
- testReportWidthInputHandlingForAuto() : void
- Test that the report width will be set to a non-0 positive integer when set to "auto".
- testReportWidthSetFromCLIOverrulesConfFile() : void
- Test that a report width passed as a CLI argument will overrule a report width set in a CodeSniffer.conf file.
- testReportWidthWhenSetFromCLIFirstValuePrevails() : void
- Test that the report width will be set correctly when multiple report widths are passed on the CLI.
- testReportWidthWillBeSetFromAutoWhenNotFoundInConfFile() : void
- Test that the report width will be set to a non-0 positive integer when not found in the CodeSniffer.conf file.
Methods
cleanConfig()
Set static properties in the Config class to prevent tests influencing each other.
public
static cleanConfig() : void
Tags
dataReportWidthInputHandling()
Data provider.
public
static dataReportWidthInputHandling() : array<string, array<string, mixed>>
Return values
array<string, array<string, mixed>>resetConfig()
Clean up after each finished test.
public
resetConfig() : void
Tags
resetConfigToDefaults()
Reset the static properties in the Config class to their true defaults to prevent this class from influencing other tests.
public
static resetConfigToDefaults() : void
Tags
setStaticProperty()
Helper function to set a static property on the Config class.
public
static setStaticProperty(string $name, mixed $value) : void
Parameters
- $name : string
-
The name of the property to set.
- $value : mixed
-
The value to set the property to.
testReportWidthCanBeSetFromCLI()
Test that the report width will be set correctly when passed as a CLI argument.
public
testReportWidthCanBeSetFromCLI() : void
Tags
testReportWidthCanBeSetFromConfFile()
Test that the report width will be set correctly when found in the CodeSniffer.conf file.
public
testReportWidthCanBeSetFromConfFile() : void
Tags
testReportWidthDefault()
Test that report width without overrules will always be set to a non-0 positive integer.
public
testReportWidthDefault() : void
Tags
testReportWidthInputHandling()
Test that the report width will be set correctly for various types of input.
public
testReportWidthInputHandling(mixed $value, int $expected) : void
Parameters
- $value : mixed
-
Input value received.
- $expected : int
-
Expected report width.
Tags
testReportWidthInputHandlingForAuto()
Test that the report width will be set to a non-0 positive integer when set to "auto".
public
testReportWidthInputHandlingForAuto() : void
Tags
testReportWidthSetFromCLIOverrulesConfFile()
Test that a report width passed as a CLI argument will overrule a report width set in a CodeSniffer.conf file.
public
testReportWidthSetFromCLIOverrulesConfFile() : void
Tags
testReportWidthWhenSetFromCLIFirstValuePrevails()
Test that the report width will be set correctly when multiple report widths are passed on the CLI.
public
testReportWidthWhenSetFromCLIFirstValuePrevails() : void
Tags
testReportWidthWillBeSetFromAutoWhenNotFoundInConfFile()
Test that the report width will be set to a non-0 positive integer when not found in the CodeSniffer.conf file.
public
testReportWidthWillBeSetFromAutoWhenNotFoundInConfFile() : void