PHP Класс PhpCsFixer\Test\AbstractFixerTestCase

Автор: Dariusz Rumiński ([email protected])
Наследование: extends PHPUnit_Framework_TestCase
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$fixer null | PhpCsFixer\Fixer\FixerInterface
$linter PhpCsFixer\Linter\LinterInterface

Защищенные методы

Метод Описание
createFixer ( ) : PhpCsFixer\Fixer\FixerInterface
createFixerFactory ( ) : FixerFactory Create fixer factory with all needed fixers registered.
doTest ( string $expected, string | null $input = null, SplFileInfo $file = null ) Tests if a fixer fixes a given string to match the expected result.
getFixerName ( ) : string
getTestFile ( string $filename = __FILE__ ) : SplFileInfo
lintSource ( string $source ) : string | null
setUp ( )

Приватные методы

Метод Описание
assertTokens ( Tokens $expectedTokens, Tokens $inputTokens )
getFixerClassName ( ) : string
getLinter ( ) : PhpCsFixer\Linter\LinterInterface

Описание методов

createFixer() защищенный Метод

protected createFixer ( ) : PhpCsFixer\Fixer\FixerInterface
Результат PhpCsFixer\Fixer\FixerInterface

createFixerFactory() защищенный Метод

Create fixer factory with all needed fixers registered.
protected createFixerFactory ( ) : FixerFactory
Результат PhpCsFixer\FixerFactory

doTest() защищенный Метод

It is used both if you want to test if something is fixed or if it is not touched by the fixer. It also makes sure that the expected output does not change when run through the fixer. That means that you do not need two test cases like [$expected] and [$expected, $input] (where $expected is the same in both cases) as the latter covers both of them. This method throws an exception if $expected and $input are equal to prevent test cases that accidentally do not test anything.
protected doTest ( string $expected, string | null $input = null, SplFileInfo $file = null )
$expected string The expected fixer output
$input string | null The fixer input, or null if it should intentionally be equal to the output
$file SplFileInfo The file to fix, or null if unneeded

getFixerName() защищенный Метод

protected getFixerName ( ) : string
Результат string

getTestFile() защищенный Метод

protected getTestFile ( string $filename = __FILE__ ) : SplFileInfo
$filename string
Результат SplFileInfo

lintSource() защищенный Метод

protected lintSource ( string $source ) : string | null
$source string
Результат string | null

setUp() защищенный Метод

protected setUp ( )

Описание свойств

$fixer защищенное свойство

protected null|FixerInterface,PhpCsFixer\Fixer $fixer
Результат null | PhpCsFixer\Fixer\FixerInterface

$linter защищенное свойство

protected LinterInterface,PhpCsFixer\Linter $linter
Результат PhpCsFixer\Linter\LinterInterface