PHP 클래스 PhpCsFixer\Test\AbstractFixerTestCase

저자: Dariusz Rumiński ([email protected])
상속: extends PHPUnit_Framework_TestCase
파일 보기 프로젝트 열기: friendsofphp/php-cs-fixer 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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