Skip to content

Commit be5b05b

Browse files
Merge remote-tracking branch 'remotes/github/MAGETWO-80120' into EPAM-PR-55
2 parents 2369a4e + b1bcd37 commit be5b05b

File tree

4 files changed

+26
-2
lines changed

4 files changed

+26
-2
lines changed

lib/internal/Magento/Framework/App/Test/Unit/BootstrapTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,4 +298,13 @@ public function assertInstalledDataProvider()
298298
[true, false],
299299
];
300300
}
301+
302+
/**
303+
* Restore error handler after Bootstrap->run method
304+
*/
305+
public function tearDown()
306+
{
307+
restore_error_handler();
308+
setCustomErrorHandler();
309+
}
301310
}

lib/internal/Magento/Framework/Setup/Test/Unit/Declaration/Schema/Db/SchemaBuilderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ public function testBuildUnknownIndexColumn(array $columns, array $references, a
312312
Schema::class,
313313
['resourceConnection' => $resourceConnectionMock]
314314
);
315-
$this->expectException(\Exception::class);
315+
$this->expectException(\PHPUnit\Framework\Exception::class);
316316
$this->expectExceptionMessage(
317317
'User Warning: Column unknown_column does not exist for index/constraint FIRST_INDEX in table second_table.'
318318
);

lib/internal/Magento/Framework/Unserialize/Test/Unit/UnserializeTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,16 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento\Framework\Unserialize\Test\Unit;
79

810
use Magento\Framework\Serialize\Serializer\Serialize;
911
use Magento\Framework\Unserialize\Unserialize;
1012

13+
/**
14+
* Test unserializer that does not unserialize objects.
15+
*/
1116
class UnserializeTest extends \PHPUnit\Framework\TestCase
1217
{
1318
/**
@@ -52,6 +57,10 @@ public function testUnserializeArray()
5257
*/
5358
public function testUnserializeObject($serialized)
5459
{
60+
$this->expectException(\PHPUnit\Framework\Exception::class);
61+
$this->expectExceptionMessage(
62+
'String contains serialized object'
63+
);
5564
$this->assertFalse($this->unserialize->unserialize($serialized));
5665
}
5766

lib/internal/Magento/Framework/View/Test/Unit/TemplateEngine/PhpTest.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento\Framework\View\Test\Unit\TemplateEngine;
79

10+
/**
11+
* Test template engine that enables PHP templates to be used for rendering.
12+
*/
813
class PhpTest extends \PHPUnit\Framework\TestCase
914
{
1015
const TEST_PROP_VALUE = 'TEST_PROP_VALUE';
@@ -55,7 +60,7 @@ public function testRender()
5560
* Test the render() function with a nonexistent filename.
5661
*
5762
* Expect an exception if the specified file does not exist.
58-
* @expectedException \Exception
63+
* @expectedException PHPUnit\Framework\Exception
5964
*/
6065
public function testRenderException()
6166
{
@@ -66,6 +71,7 @@ public function testRenderException()
6671
)->disableOriginalConstructor()->getMock();
6772

6873
$filename = 'This_is_not_a_file';
74+
6975
$this->_phpEngine->render($blockMock, $filename);
7076
}
7177

0 commit comments

Comments
 (0)