Skip to content

Commit ec32847

Browse files
MC-41153: Fix broken builds on 2.3.7-develop
1 parent 66a29d0 commit ec32847

File tree

3 files changed

+43
-7
lines changed

3 files changed

+43
-7
lines changed

app/code/Magento/Cms/Test/Unit/Model/Wysiwyg/Images/StorageTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,10 +541,14 @@ public function testUploadFile()
541541
}
542542

543543
/**
544-
* @expectedException \Magento\Framework\Exception\LocalizedException
544+
*
545545
*/
546546
public function testUploadFileWithExcessivePath()
547547
{
548+
$this->expectException(
549+
\Magento\Framework\Exception\LocalizedException::class
550+
);
551+
548552
$path = 'target/path';
549553
$targetPath = self::STORAGE_ROOT_DIR .str_repeat('a', 255) . $path;
550554
$type = 'image';

app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/ImageTest.php

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,27 +76,27 @@ class ImageTest extends AbstractFormTestCase
7676
private $fileProcessorFactoryMock;
7777

7878
/**
79-
* @var File|PHPUnit_Framework_MockObject_MockObject
79+
* @var File|\PHPUnit\Framework\MockObject\MockObject
8080
*/
8181
private $ioFileSystemMock;
8282

8383
/**
84-
* @var DirectoryList|PHPUnit_Framework_MockObject_MockObject
84+
* @var DirectoryList|\PHPUnit\Framework\MockObject\MockObject
8585
*/
8686
private $directoryListMock;
8787

8888
/**
89-
* @var WriteFactory|PHPUnit_Framework_MockObject_MockObject
89+
* @var WriteFactory|\PHPUnit\Framework\MockObject\MockObject
9090
*/
9191
private $writeFactoryMock;
9292

9393
/**
94-
* @var Write|PHPUnit_Framework_MockObject_MockObject
94+
* @var Write|\PHPUnit\Framework\MockObject\MockObject
9595
*/
9696
private $mediaEntityTmpDirectoryMock;
9797

9898
/**
99-
* @var Driver|PHPUnit_Framework_MockObject_MockObject
99+
* @var Driver|\PHPUnit\Framework\MockObject\MockObject
100100
*/
101101
private $driverMock;
102102

@@ -251,6 +251,14 @@ public function testValidate()
251251
->with(FileProcessor::TMP_DIR . '/' . $value['name'])
252252
->willReturn(true);
253253

254+
$this->ioFileSystemMock->expects($this->any())
255+
->method('getPathInfo')
256+
->with($value['name'])
257+
->willReturn([
258+
'extension' => 'gif',
259+
'filename' => 'logo'
260+
]);
261+
254262
$model = $this->initialize([
255263
'value' => $value,
256264
'isAjax' => false,
@@ -304,6 +312,14 @@ public function testValidateMaxFileSize()
304312
->with(FileProcessor::TMP_DIR . '/' . $value['name'])
305313
->willReturn(true);
306314

315+
$this->ioFileSystemMock->expects($this->any())
316+
->method('getPathInfo')
317+
->with($value['name'])
318+
->willReturn([
319+
'extension' => 'gif',
320+
'filename' => 'logo'
321+
]);
322+
307323
$model = $this->initialize([
308324
'value' => $value,
309325
'isAjax' => false,
@@ -356,6 +372,14 @@ public function testValidateMaxImageWidth()
356372
->with(FileProcessor::TMP_DIR . '/' . $value['name'])
357373
->willReturn(true);
358374

375+
$this->ioFileSystemMock->expects($this->any())
376+
->method('getPathInfo')
377+
->with($value['name'])
378+
->willReturn([
379+
'extension' => 'gif',
380+
'filename' => 'logo'
381+
]);
382+
359383
$model = $this->initialize([
360384
'value' => $value,
361385
'isAjax' => false,
@@ -408,6 +432,14 @@ public function testValidateMaxImageHeight()
408432
->with(FileProcessor::TMP_DIR . '/' . $value['name'])
409433
->willReturn(true);
410434

435+
$this->ioFileSystemMock->expects($this->any())
436+
->method('getPathInfo')
437+
->with($value['name'])
438+
->willReturn([
439+
'extension' => 'gif',
440+
'filename' => 'logo'
441+
]);
442+
411443
$model = $this->initialize([
412444
'value' => $value,
413445
'isAjax' => false,

dev/tests/integration/testsuite/Magento/Customer/Model/Metadata/Form/ImageTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public function testProcessCustomerInvalidValue()
199199
* @inheritdoc
200200
* @throws FileSystemException
201201
*/
202-
public static function tearDownAfterClass()
202+
public static function tearDownAfterClass(): void
203203
{
204204
parent::tearDownAfterClass();
205205
$filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(

0 commit comments

Comments
 (0)