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