Skip to content

Commit 739982d

Browse files
committed
Merge remote-tracking branch 'origin/MAGETWO-95635' into 2.2.7-develop-pr53
2 parents 67681a5 + 526a133 commit 739982d

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

app/code/Magento/Store/etc/config.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@
130130
<html>html</html>
131131
<phtml>phtml</phtml>
132132
<shtml>shtml</shtml>
133+
<phpt>phpt</phpt>
134+
<pht>pht</pht>
133135
</protected_extensions>
134136
<public_files_valid_paths>
135137
<protected>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Framework\Code\File\Validator;
9+
10+
use Magento\TestFramework\Helper\Bootstrap;
11+
12+
/**
13+
* Tests protected extensions.
14+
*/
15+
class NotProtectedExtensionTest extends \PHPUnit\Framework\TestCase
16+
{
17+
/**
18+
* Tests that phpt, pht are invalid extension types.
19+
*
20+
* @dataProvider isValidDataProvider
21+
* @param string $extension
22+
* @return void
23+
*/
24+
public function testIsValid(string $extension)
25+
{
26+
$objectManager = Bootstrap::getObjectManager();
27+
/** @var \Magento\MediaStorage\Model\File\Validator\NotProtectedExtension $model */
28+
$model = $objectManager->create(\Magento\MediaStorage\Model\File\Validator\NotProtectedExtension::class);
29+
$this->assertFalse($model->isValid($extension));
30+
}
31+
32+
/**
33+
* @return array
34+
*/
35+
public function isValidDataProvider(): array
36+
{
37+
return [
38+
['phpt'],
39+
['pht'],
40+
];
41+
}
42+
}

0 commit comments

Comments
 (0)