Skip to content

Commit 71778cb

Browse files
committed
Merge remote-tracking branch 'origin/MAGETWO-95634' into 2.1.16-develop-pr59
2 parents 962accf + 412d796 commit 71778cb

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+
7+
namespace Magento\Framework\Code\File\Validator;
8+
9+
use Magento\TestFramework\Helper\Bootstrap;
10+
11+
/**
12+
* Tests protected extensions.
13+
*/
14+
class NotProtectedExtensionTest extends \PHPUnit_Framework_TestCase
15+
{
16+
/**
17+
* Test that phpt, pht is invalid extension type
18+
* @dataProvider isValidDataProvider
19+
* @param string $extension
20+
* @return void
21+
*/
22+
public function testIsValid($extension)
23+
{
24+
$objectManager = Bootstrap::getObjectManager();
25+
/** @var \Magento\MediaStorage\Model\File\Validator\NotProtectedExtension $model */
26+
$model = $objectManager->create(\Magento\MediaStorage\Model\File\Validator\NotProtectedExtension::class);
27+
$this->assertFalse($model->isValid($extension));
28+
}
29+
30+
/**
31+
* Data provider for testIsValid
32+
*
33+
* @return array
34+
*/
35+
public function isValidDataProvider()
36+
{
37+
return [
38+
['phpt'],
39+
['pht'],
40+
];
41+
}
42+
}

0 commit comments

Comments
 (0)