-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
83 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of PHP CS Fixer. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* Dariusz Rumiński <dariusz.ruminski@gmail.com> | ||
* | ||
* This source file is subject to the MIT license that is bundled | ||
* with this source code in the file LICENSE. | ||
*/ | ||
|
||
namespace PhpCsFixer\Tests\Console\Command; | ||
|
||
use PhpCsFixer\Console\Application; | ||
use PhpCsFixer\Console\Command\ListFilesCommand; | ||
use PhpCsFixer\Tests\TestCase; | ||
use PhpCsFixer\ToolInfo; | ||
use Symfony\Component\Console\Tester\CommandTester; | ||
|
||
/** | ||
* @internal | ||
* | ||
* @covers \PhpCsFixer\Console\Command\ListFilesCommand | ||
*/ | ||
final class ListFilesCommandTest extends TestCase | ||
{ | ||
public function testEmptyRulesValue() | ||
{ | ||
$commandTester = $this->doTestExecute(); | ||
// TODO adjust expectation | ||
$this->assertSame('', $commandTester->getDisplay()); | ||
} | ||
|
||
/** | ||
* @return CommandTester | ||
*/ | ||
private function doTestExecute(/*array $arguments*/) | ||
{ | ||
$application = new Application(); | ||
$application->add(new ListFilesCommand(new ToolInfo())); | ||
|
||
$command = $application->find('list-files'); | ||
$commandTester = new CommandTester($command); | ||
|
||
$commandTester->execute([ | ||
'--config' => __DIR__.'/test-project/.php_cs' | ||
] | ||
); | ||
|
||
return $commandTester; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
$finder = PhpCsFixer\Finder::create() | ||
->in([ | ||
__DIR__ | ||
]) | ||
->exclude([ | ||
]) | ||
; | ||
|
||
return PhpCsFixer\Config::create() | ||
->setUsingCache(false) | ||
->setRules([ | ||
'@Symfony' => true, | ||
]) | ||
->setRiskyAllowed(true) | ||
->setFinder($finder) | ||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
function abc() {} | ||
|
||
function def() | ||
{ | ||
|
||
} |