mirror of
https://github.com/DirectoryLister/DirectoryLister.git
synced 2025-08-24 14:42:53 +02:00
add tests for dot_files to FinderFactoryTest.php
add test_dot_files_are_returned(): full directory content including .dot_file and .dot_dir add public function test_dot_directory_contents_are_returned(): subdirectory .dot_dir content containing .dot_file
This commit is contained in:
committed by
GitHub
parent
c8144cc4d7
commit
38336cafa8
@@ -97,6 +97,46 @@ class FinderFactoryTest extends TestCase
|
||||
], $this->getFilesArray($finder));
|
||||
}
|
||||
|
||||
public function test_dot_files_are_returned(): void
|
||||
{
|
||||
$this->container->set('hidden_files', []);
|
||||
$this->container->set('hide_dot_files', FALSE);
|
||||
|
||||
$finder = (new FinderFactory(
|
||||
$this->container,
|
||||
$this->config,
|
||||
HiddenFiles::fromConfig($this->config)
|
||||
))();
|
||||
$finder->in($this->filePath('subdir'))->depth(0);
|
||||
|
||||
$this->assertInstanceOf(Finder::class, $finder);
|
||||
$this->assertEquals([
|
||||
'.dot_dir',
|
||||
'.dot_file',
|
||||
'alpha.scss',
|
||||
'bravo.js',
|
||||
'charlie.bash',
|
||||
'delta.html',
|
||||
'echo.yaml',
|
||||
], $this->getFilesArray($finder));
|
||||
}
|
||||
|
||||
public function test_dot_directory_contents_are_returned(): void
|
||||
{
|
||||
$this->container->set('hidden_files', []);
|
||||
$this->container->set('hide_dot_files', FALSE);
|
||||
|
||||
$finder = (new FinderFactory(
|
||||
$this->container,
|
||||
$this->config,
|
||||
HiddenFiles::fromConfig($this->config)
|
||||
))();
|
||||
$finder->in($this->filePath('subdir/.dot_dir'))->depth(0);
|
||||
|
||||
$this->assertInstanceOf(Finder::class, $finder);
|
||||
$this->assertEquals(['.dot_file'], $this->getFilesArray($finder));
|
||||
}
|
||||
|
||||
public function test_it_throws_a_runtime_exception_with_an_invalid_sort_order(): void
|
||||
{
|
||||
$this->container->set('sort_order', 'invalid');
|
||||
|
Reference in New Issue
Block a user