2 /***************************************************************
5 * (c) 2010-2011 Oliver Hader <oliver@typo3.org>
8 * This script is part of the TYPO3 project. The TYPO3 project is
9 * free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * The GNU General Public License can be found at
15 * http://www.gnu.org/copyleft/gpl.html.
17 * This script is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * This copyright notice MUST APPEAR in all copies of the script!
23 ***************************************************************/
26 * Test case for basic core related constants in config_default.php
28 * @author Oliver Hader <oliver@typo3.org>
32 class config_defaultTest
extends tx_phpunit_testcase
{
34 * Tests whether an accordant PHP extension is denied.
36 * @param string phpExtension
37 * @dataProvider phpExtensionsDataProvider
40 public function fileDenyPatternMatchesPhpExtension($phpExtension) {
41 $this->assertGreaterThan(0, preg_match('/' . FILE_DENY_PATTERN_DEFAULT
. '/', $phpExtension), $phpExtension);
45 * Data provider for 'fileDenyPatternMatchesPhpExtension' test case.
49 public function phpExtensionsDataProvider() {
50 $fileName = uniqid('filename');
53 $phpExtensions = t3lib_div
::trimExplode(',', 'php,php3,php4,php5,php6,phpsh,phtml', TRUE);
55 foreach ($phpExtensions as $extension) {
56 $data[] = array($fileName . '.' . $extension);
57 $data[] = array($fileName . '.' . $extension . '.txt');