File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
setup/src/Magento/Setup/Test/Unit/Console/Command Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 6
6
namespace Magento \Setup \Test \Unit \Console \Command ;
7
7
8
8
use Magento \Framework \Component \ComponentRegistrar ;
9
+ use Magento \Framework \TestFramework \Unit \Helper \ObjectManager ;
9
10
use Magento \Setup \Console \Command \DiCompileCommand ;
10
11
use Magento \Setup \Module \Di \App \Task \OperationFactory ;
11
12
use Symfony \Component \Console \Tester \CommandTester ;
@@ -121,18 +122,19 @@ public function testExecute()
121
122
->method ('get ' )
122
123
->with (\Magento \Framework \Config \ConfigOptionsListConstants::KEY_MODULES )
123
124
->willReturn (['Magento_Catalog ' => 1 ]);
124
- $ progressBar = $ this ->getMockBuilder (
125
- \Symfony \Component \Console \Helper \ProgressBar::class
126
- )
127
- ->disableOriginalConstructor ()
128
- ->getMock ();
125
+
126
+ $ objectManager = new ObjectManager ($ this );
129
127
130
128
$ this ->objectManagerMock ->expects ($ this ->once ())->method ('configure ' );
131
129
$ this ->objectManagerMock
132
130
->expects ($ this ->once ())
133
131
->method ('create ' )
134
132
->with (\Symfony \Component \Console \Helper \ProgressBar::class)
135
- ->willReturn ($ progressBar );
133
+ ->willReturnCallback (
134
+ function ($ class , $ arguments ) use ($ objectManager ) {
135
+ return $ objectManager ->getObject ($ class , $ arguments );
136
+ }
137
+ );
136
138
137
139
$ this ->managerMock ->expects ($ this ->exactly (7 ))->method ('addOperation ' )
138
140
->withConsecutive (
You can’t perform that action at this time.
0 commit comments