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 Original file line number Diff line number Diff line change 5
5
*/
6
6
namespace Magento \Setup \Test \Unit \Module \I18n \Dictionary \Writer \Csv ;
7
7
8
+ use Magento \Setup \Module \I18n \Dictionary \Writer \Csv \Stdo ;
9
+
8
10
class StdoTest extends \PHPUnit_Framework_TestCase
9
11
{
10
- /**
11
- * @var resource
12
- */
13
- protected $ _handler ;
14
-
15
- protected function setUp ()
16
- {
17
- $ this ->_handler = STDOUT ;
18
- }
19
-
20
12
public function testThatHandlerIsRight ()
21
13
{
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 );
28
18
}
29
19
}
You can’t perform that action at this time.
0 commit comments