‪TYPO3CMS  9.5
FileNameFilterTest.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
18 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
19 
23 class ‪FileNameFilterTest extends UnitTestCase
24 {
31  {
32  return [
33  ['file', '/file', true],
34  ['.htaccess', '/.htaccess', -1],
35  ['applypatch-msg.sample', '/.git/applypatch-msg.sample', -1],
36  ['applypatch-msg.sample', '/user_upload/.git/applypatch-msg.sample', -1],
37  ];
38  }
39 
46  {
47  return [
48  ['file', '/file', true],
49  ['.htaccess', '/.htaccess', true],
50  ['applypatch-msg.sample', '/.git/applypatch-msg.sample', true],
51  ['applypatch-msg.sample', '/user_upload/.git/applypatch-msg.sample', true],
52  ];
53  }
54 
62  public function ‪filterHiddenFilesAndFoldersFiltersHiddenFilesAndFolders($itemName, $itemIdentifier, $expected)
63  {
66  $driverMock = $this->createMock(DriverInterface::class);
67  $this->assertSame(
68  $expected,
70  $itemName,
71  $itemIdentifier,
72  '',
73  [],
74  $driverMock
75  )
76  );
77  }
78 
86  public function ‪filterHiddenFilesAndFoldersAllowsHiddenFilesAndFolders($itemName, $itemIdentifier, $expected)
87  {
89  $driverMock = $this->createMock(DriverInterface::class);
91  $this->assertSame(
93  $itemName,
94  $itemIdentifier,
95  '',
96  [],
97  $driverMock
98  ),
99  $expected
100  );
101  }
102 }
‪TYPO3\CMS\Core\Tests\Unit\Resource\Filter
Definition: FileNameFilterTest.php:2
‪TYPO3\CMS\Core\Tests\Unit\Resource\Filter\FileNameFilterTest\getItemsAndPathsWithHiddenFilesAndFolders_dataProvider
‪array getItemsAndPathsWithHiddenFilesAndFolders_dataProvider()
Definition: FileNameFilterTest.php:45
‪TYPO3\CMS\Core\Resource\Driver\DriverInterface
Definition: DriverInterface.php:22
‪TYPO3\CMS\Core\Tests\Unit\Resource\Filter\FileNameFilterTest\getItemsAndPathsWithoutHiddenFilesAndFolders_dataProvider
‪array getItemsAndPathsWithoutHiddenFilesAndFolders_dataProvider()
Definition: FileNameFilterTest.php:30
‪TYPO3\CMS\Core\Tests\Unit\Resource\Filter\FileNameFilterTest\filterHiddenFilesAndFoldersAllowsHiddenFilesAndFolders
‪filterHiddenFilesAndFoldersAllowsHiddenFilesAndFolders($itemName, $itemIdentifier, $expected)
Definition: FileNameFilterTest.php:86
‪TYPO3\CMS\Core\Resource\Filter\FileNameFilter\filterHiddenFilesAndFolders
‪static bool int filterHiddenFilesAndFolders($itemName, $itemIdentifier, $parentIdentifier, array $additionalInformation, DriverInterface $driverInstance)
Definition: FileNameFilter.php:43
‪TYPO3\CMS\Core\Resource\Filter\FileNameFilter\setShowHiddenFilesAndFolders
‪static bool setShowHiddenFilesAndFolders($showHiddenFilesAndFolders)
Definition: FileNameFilter.php:70
‪TYPO3\CMS\Core\Tests\Unit\Resource\Filter\FileNameFilterTest\filterHiddenFilesAndFoldersFiltersHiddenFilesAndFolders
‪filterHiddenFilesAndFoldersFiltersHiddenFilesAndFolders($itemName, $itemIdentifier, $expected)
Definition: FileNameFilterTest.php:62
‪TYPO3\CMS\Core\Resource\Filter\FileNameFilter
Definition: FileNameFilter.php:23
‪TYPO3\CMS\Core\Tests\Unit\Resource\Filter\FileNameFilterTest
Definition: FileNameFilterTest.php:24