6
6
namespace Magento \Setup \Test \Unit \Module ;
7
7
8
8
use Magento \Framework \App \DeploymentConfig ;
9
+ use Magento \Framework \Config \Data \ConfigData ;
10
+ use Magento \Framework \Config \Data \ConfigDataFactory ;
9
11
use Magento \Framework \Config \File \ConfigFilePool ;
10
12
use Magento \Framework \Math \Random ;
13
+ use Magento \Framework \TestFramework \Unit \Helper \ObjectManager ;
11
14
use Magento \Setup \Model \ConfigGenerator ;
12
15
use Magento \Framework \Config \ConfigOptionsListConstants ;
13
16
use Magento \Setup \Model \CryptKeyGenerator ;
17
+ use PHPUnit \Framework \TestCase ;
14
18
15
- class ConfigGeneratorTest extends \ PHPUnit \ Framework \ TestCase
19
+ class ConfigGeneratorTest extends TestCase
16
20
{
17
21
/**
18
22
* @var ConfigGenerator
@@ -31,7 +35,16 @@ protected function setUp()
31
35
32
36
$ cryptKeyGenerator = new CryptKeyGenerator ($ randomMock );
33
37
34
- $ this ->configGeneratorObject = new ConfigGenerator ($ randomMock , $ deployConfig , null , $ cryptKeyGenerator );
38
+ $ objectManagerMock = $ this ->getMockBuilder (\Magento \Framework \App \ObjectManager::class)
39
+ ->disableOriginalConstructor ()
40
+ ->getMock ();
41
+
42
+ $ objectManagerMock ->method ('create ' )->willReturn (new ConfigData ('app_env ' ));
43
+
44
+ $ configDataFactoryMock = (new ObjectManager ($ this ))
45
+ ->getObject (ConfigDataFactory::class, ['objectManager ' => $ objectManagerMock ]);
46
+
47
+ $ this ->configGeneratorObject = new ConfigGenerator ($ randomMock , $ deployConfig , $ configDataFactoryMock , $ cryptKeyGenerator );
35
48
}
36
49
37
50
public function testCreateCryptConfigWithInput ()
0 commit comments