6
6
7
7
namespace Magento \Amqp \Test \Unit \Setup ;
8
8
9
+ use Magento \Amqp \Setup \ConnectionValidator ;
10
+ use Magento \Framework \Config \Data \ConfigData ;
9
11
use Magento \Framework \TestFramework \Unit \Helper \ObjectManager ;
10
12
use Magento \Amqp \Setup \ConfigOptionsList ;
11
13
use Magento \Framework \Setup \Option \TextConfigOption ;
12
14
use Magento \Framework \App \DeploymentConfig ;
15
+ use PHPUnit \Framework \MockObject \MockObject ;
16
+ use PHPUnit \Framework \TestCase ;
13
17
14
- class ConfigOptionsListTest extends \ PHPUnit \ Framework \ TestCase
18
+ class ConfigOptionsListTest extends TestCase
15
19
{
16
20
/**
17
21
* @var ObjectManager
@@ -24,12 +28,12 @@ class ConfigOptionsListTest extends \PHPUnit\Framework\TestCase
24
28
private $ model ;
25
29
26
30
/**
27
- * @var \Magento\Amqp\Setup\ ConnectionValidator|\PHPUnit_Framework_MockObject_MockObject
31
+ * @var ConnectionValidator|MockObject
28
32
*/
29
33
private $ connectionValidatorMock ;
30
34
31
35
/**
32
- * @var \Magento\Framework\App\ DeploymentConfig|\PHPUnit_Framework_MockObject_MockObject
36
+ * @var DeploymentConfig|MockObject
33
37
*/
34
38
private $ deploymentConfigMock ;
35
39
@@ -38,7 +42,7 @@ class ConfigOptionsListTest extends \PHPUnit\Framework\TestCase
38
42
*/
39
43
private $ options ;
40
44
41
- protected function setUp ()
45
+ protected function setUp (): void
42
46
{
43
47
$ this ->options = [
44
48
ConfigOptionsList::INPUT_KEY_QUEUE_AMQP_HOST => 'host ' ,
@@ -51,18 +55,18 @@ protected function setUp()
51
55
];
52
56
53
57
$ this ->objectManager = new ObjectManager ($ this );
54
- $ this ->connectionValidatorMock = $ this ->getMockBuilder (\ Magento \ Amqp \ Setup \ ConnectionValidator::class)
58
+ $ this ->connectionValidatorMock = $ this ->getMockBuilder (ConnectionValidator::class)
55
59
->disableOriginalConstructor ()
56
60
->setMethods ([])
57
61
->getMock ();
58
62
59
- $ this ->deploymentConfigMock = $ this ->getMockBuilder (\ Magento \ Framework \ App \ DeploymentConfig::class)
63
+ $ this ->deploymentConfigMock = $ this ->getMockBuilder (DeploymentConfig::class)
60
64
->disableOriginalConstructor ()
61
65
->setMethods ([])
62
66
->getMock ();
63
67
64
68
$ this ->model = $ this ->objectManager ->getObject (
65
- \ Magento \ Amqp \ Setup \ ConfigOptionsList::class,
69
+ ConfigOptionsList::class,
66
70
[
67
71
'connectionValidator ' => $ this ->connectionValidatorMock ,
68
72
]
@@ -135,9 +139,9 @@ public function testCreateConfig($options, $expectedConfigData)
135
139
$ result = $ this ->model ->createConfig ($ options , $ this ->deploymentConfigMock );
136
140
$ this ->assertInternalType ('array ' , $ result );
137
141
$ this ->assertNotEmpty ($ result );
138
- /** @var \Magento\Framework\Config\Data\ ConfigData $configData */
142
+ /** @var ConfigData $configData */
139
143
$ configData = $ result [0 ];
140
- $ this ->assertInstanceOf (\ Magento \ Framework \ Config \ Data \ ConfigData::class, $ configData );
144
+ $ this ->assertInstanceOf (ConfigData::class, $ configData );
141
145
$ this ->assertEquals ($ expectedConfigData , $ configData ->getData ());
142
146
}
143
147
0 commit comments