Skip to content

Commit

Permalink
MAGETWO-64904: [GitHub][PR] Fix #8315: test setup/src/Magento/Setup/T…
Browse files Browse the repository at this point in the history
…est/Unit/Module/I18n/Dictionary/Writer/Csv/StdoTest.php crashes in debug mode #8610

 - Merge Pull Request #8610 from orlangur/magento2:fix-test-setup/src/Magento/Setup/Test/Unit/Module/I18n/Dictionary/Writer/Csv/StdoTest.php
  • Loading branch information
Oleksii Korshenko committed Feb 21, 2017
2 parents c7fff61 + 0f54844 commit 8069621
Showing 1 changed file with 6 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,15 @@
*/
namespace Magento\Setup\Test\Unit\Module\I18n\Dictionary\Writer\Csv;

use Magento\Setup\Module\I18n\Dictionary\Writer\Csv\Stdo;

class StdoTest extends \PHPUnit_Framework_TestCase
{
/**
* @var resource
*/
protected $_handler;

protected function setUp()
{
$this->_handler = STDOUT;
}

public function testThatHandlerIsRight()
{
$this->markTestSkipped('This is skiped as we should not close the STDO!');
$objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
/** @var \Magento\Setup\Module\I18n\Dictionary\Writer\Csv $writer */
$writer = $objectManagerHelper->getObject(\Magento\Setup\Module\I18n\Dictionary\Writer\Csv\Stdo::class);

$this->assertAttributeEquals($this->_handler, '_fileHandler', $writer);
$handler = STDOUT;
// Mocking object's under test destructor here is perfectly valid as there is no way to reopen STDOUT
$writer = $this->getMock(Stdo::class, ['__destruct']);
$this->assertAttributeEquals($handler, '_fileHandler', $writer);
}
}

0 comments on commit 8069621

Please sign in to comment.