PHP Class PhpCsFixer\Test\AbstractIntegrationTestCase

This test searches for '.test' fixture files in the given directory. Each fixture file will be parsed and tested against the expected result. Fixture files have the following format: --TEST-- Example test description. --CONFIG-- {"@PSR2": true, "strict": true} --SETTINGS--* checkPriority=true --REQUIREMENTS--* php=5.4** hhvm=false*** --EXPECT-- Expected code after fixing --INPUT--* Code to fix * Section or any line in it may be omitted. ** PHP minimum version. Default to current running php version (no effect). *** HHVM compliant flag. Default to true. Set to false to skip test under HHVM.
Author: SpacePossum ([email protected])
Inheritance: extends PHPUnit_Framework_TestCase
Exibir arquivo Open project: friendsofphp/php-cs-fixer

Protected Properties

Property Type Description
$linter PhpCsFixer\Linter\LinterInterface

Public Methods

Method Description
getTests ( ) : IntegrationCase[][] Creates test data by parsing '.test' files.
setUpBeforeClass ( )
tearDownAfterClass ( )
testIntegration ( IntegrationCase $case )

Protected Methods

Method Description
doTest ( IntegrationCase $case ) Applies the given fixers on the input and checks the result.
getFixturesDir ( ) : string Returns the full path to directory which contains the tests.
getTempFile ( ) : string Returns the full path to the temporary file where the test will write to.
setUp ( )

Private Methods

Method Description
createFixers ( IntegrationCase $case ) : PhpCsFixer\Fixer\FixerInterface[]
getLinter ( ) : PhpCsFixer\Linter\LinterInterface
implodeErrors ( array $errors ) : string

Method Details

doTest() protected method

It will write the input to a temp file. The file will be fixed by a Fixer instance configured with the given fixers. The result is compared with the expected output. It checks if no errors were reported during the fixing.
protected doTest ( IntegrationCase $case )
$case IntegrationCase

getFixturesDir() protected static method

Returns the full path to directory which contains the tests.
protected static getFixturesDir ( ) : string
return string

getTempFile() protected static method

Returns the full path to the temporary file where the test will write to.
protected static getTempFile ( ) : string
return string

getTests() public method

Creates test data by parsing '.test' files.
public getTests ( ) : IntegrationCase[][]
return IntegrationCase[][]

setUp() protected method

protected setUp ( )

setUpBeforeClass() public static method

public static setUpBeforeClass ( )

tearDownAfterClass() public static method

public static tearDownAfterClass ( )

testIntegration() public method

See also: doTest()
public testIntegration ( IntegrationCase $case )
$case IntegrationCase

Property Details

$linter protected_oe property

protected LinterInterface,PhpCsFixer\Linter $linter
return PhpCsFixer\Linter\LinterInterface