Skip to content
This repository was archived by the owner on Dec 19, 2019. It is now read-only.

Commit 8069621

Browse files
author
Oleksii Korshenko
committed
MAGETWO-64904: [GitHub][PR] Fix #8315: test setup/src/Magento/Setup/Test/Unit/Module/I18n/Dictionary/Writer/Csv/StdoTest.php crashes in debug mode magento/magento2#8610
- Merge Pull Request magento/magento2#8610 from orlangur/magento2:fix-test-setup/src/Magento/Setup/Test/Unit/Module/I18n/Dictionary/Writer/Csv/StdoTest.php
2 parents c7fff61 + 0f54844 commit 8069621

File tree

1 file changed

+6
-16
lines changed
  • setup/src/Magento/Setup/Test/Unit/Module/I18n/Dictionary/Writer/Csv

1 file changed

+6
-16
lines changed

setup/src/Magento/Setup/Test/Unit/Module/I18n/Dictionary/Writer/Csv/StdoTest.php

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,15 @@
55
*/
66
namespace Magento\Setup\Test\Unit\Module\I18n\Dictionary\Writer\Csv;
77

8+
use Magento\Setup\Module\I18n\Dictionary\Writer\Csv\Stdo;
9+
810
class StdoTest extends \PHPUnit_Framework_TestCase
911
{
10-
/**
11-
* @var resource
12-
*/
13-
protected $_handler;
14-
15-
protected function setUp()
16-
{
17-
$this->_handler = STDOUT;
18-
}
19-
2012
public function testThatHandlerIsRight()
2113
{
22-
$this->markTestSkipped('This is skiped as we should not close the STDO!');
23-
$objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
24-
/** @var \Magento\Setup\Module\I18n\Dictionary\Writer\Csv $writer */
25-
$writer = $objectManagerHelper->getObject(\Magento\Setup\Module\I18n\Dictionary\Writer\Csv\Stdo::class);
26-
27-
$this->assertAttributeEquals($this->_handler, '_fileHandler', $writer);
14+
$handler = STDOUT;
15+
// Mocking object's under test destructor here is perfectly valid as there is no way to reopen STDOUT
16+
$writer = $this->getMock(Stdo::class, ['__destruct']);
17+
$this->assertAttributeEquals($handler, '_fileHandler', $writer);
2818
}
2919
}

0 commit comments

Comments
 (0)