Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kubawerlos committed Dec 16, 2021
1 parent 1f4f55a commit d7fede8
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/FinderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
namespace PhpCsFixer\Tests;

use PhpCsFixer\Finder;
use Symfony\Component\Finder\SplFileInfo;

/**
* @internal
Expand All @@ -31,4 +32,23 @@ public function testThatDefaultFinderDoesNotSpecifyAnyDirectory(): void
$finder = Finder::create();
$finder->getIterator();
}

public function testThatFinderFindsDotFilesWhenConfigured(): void
{
$finder = Finder::create()
->in(__DIR__.'/..')
->depth(0)
->ignoreDotFiles(false)
;

static::assertContains(
realpath(__DIR__.'/../.php-cs-fixer.dist.php'),
array_map(
function (SplFileInfo $file): string {
return $file->getRealPath();
},
iterator_to_array($finder->getIterator())
)
);
}
}

0 comments on commit d7fede8

Please sign in to comment.