@@ -18,11 +18,6 @@ class SampleDataTest extends \PHPUnit_Framework_TestCase
18
18
*/
19
19
protected $ sampleDataInstall ;
20
20
21
- /**
22
- * @var \Magento\Framework\ObjectManagerInterface|\PHPUnit_Framework_MockObject_MockObject
23
- */
24
- protected $ objectManagerInterface ;
25
-
26
21
/**
27
22
* @var \Magento\Framework\Setup\LoggerInterface
28
23
*/
@@ -35,49 +30,11 @@ class SampleDataTest extends \PHPUnit_Framework_TestCase
35
30
36
31
protected function setUp ()
37
32
{
38
- $ this ->objectManagerInterface = $ this ->getMock (
39
- 'Magento\Framework\ObjectManagerInterface ' ,
40
- [
41
- 'get ' ,
42
- 'create ' ,
43
- 'configure '
44
- ],
45
- [],
46
- '' ,
47
- false
48
- );
49
33
$ this ->loggerInterface = $ this ->getMock ('Magento\Framework\Setup\LoggerInterface ' );
50
34
$ this ->directoryList = $ this ->getMock ('Magento\Framework\App\Filesystem\DirectoryList ' , [], [], '' , false );
51
35
$ this ->sampleDataInstall = new SampleData ($ this ->directoryList );
52
36
}
53
37
54
- public function testInstall ()
55
- {
56
- $ areaCode = 'adminhtml ' ;
57
- $ userName = 'admin ' ;
58
- $ modules = ['module_1 ' , 'module_2 ' ];
59
- $ configData = ['config_data ' ];
60
- $ sampleDataLogger = $ this ->getMock ('Magento\SampleData\Model\Logger ' , ['setSubject ' ], [], '' , false );
61
- $ appState = $ this ->getMock ('Magento\Framework\App\State ' , ['setAreaCode ' ], [], '' , false );
62
- $ configLoader = $ this ->getMock ('Magento\Framework\App\ObjectManager\ConfigLoader ' , ['load ' ], [], '' , false );
63
- $ installer = $ this ->getMock ('Magento\SampleData\Model\Installer ' , ['run ' ], [], '' , false );
64
- $ this ->objectManagerInterface ->expects ($ this ->any ())->method ('get ' )->willReturnMap (
65
- [
66
- ['Magento\SampleData\Model\Logger ' , $ sampleDataLogger ],
67
- ['Magento\Framework\App\State ' , $ appState ],
68
- ['Magento\Framework\App\ObjectManager\ConfigLoader ' , $ configLoader ],
69
- ['Magento\SampleData\Model\Installer ' , $ installer ]
70
- ]
71
- );
72
- $ sampleDataLogger ->expects ($ this ->any ())->method ('setSubject ' )->with ($ this ->loggerInterface )->willReturnSelf ();
73
- $ appState ->expects ($ this ->once ())->method ('setAreaCode ' )->with ($ areaCode )->willReturnSelf ();
74
- $ configLoader ->expects ($ this ->once ())->method ('load ' )->with ($ areaCode )->willReturn ($ configData );
75
- $ this ->objectManagerInterface ->expects ($ this ->once ())->method ('configure ' )->with ($ configData )
76
- ->willReturnSelf ();
77
- $ installer ->expects ($ this ->once ())->method ('run ' )->with ($ userName , $ modules );
78
- $ this ->sampleDataInstall ->install ($ this ->objectManagerInterface , $ this ->loggerInterface , $ userName , $ modules );
79
- }
80
-
81
38
public function testIsDeployed ()
82
39
{
83
40
$ this ->directoryList ->expects ($ this ->once ())->method ('getPath ' )->with ('code ' );
0 commit comments