11
11
use FactorioItemBrowser \Export \Entity \ProcessStepData ;
12
12
use FactorioItemBrowser \Export \Exception \ExportException ;
13
13
use FactorioItemBrowser \Export \Parser \ParserInterface ;
14
- use FactorioItemBrowser \ExportData \Entity \Combination ;
15
14
use FactorioItemBrowser \ExportData \ExportData ;
16
15
use FactorioItemBrowser \ExportQueue \Client \Constant \JobStatus ;
17
16
use PHPUnit \Framework \MockObject \MockObject ;
@@ -29,24 +28,15 @@ class ParserStepTest extends TestCase
29
28
{
30
29
use ReflectionTrait;
31
30
32
- /**
33
- * The mocked console.
34
- * @var Console&MockObject
35
- */
36
- protected $ console ;
31
+ /** @var Console&MockObject */
32
+ private $ console ;
37
33
38
- /**
39
- * Sets up the test case.
40
- */
41
34
protected function setUp (): void
42
35
{
43
- parent ::setUp ();
44
-
45
36
$ this ->console = $ this ->createMock (Console::class);
46
37
}
47
38
48
39
/**
49
- * Tests the constructing.
50
40
* @throws ReflectionException
51
41
* @covers ::__construct
52
42
*/
@@ -64,7 +54,6 @@ public function testConstruct(): void
64
54
}
65
55
66
56
/**
67
- * Tests the getLabel method.
68
57
* @covers ::getLabel
69
58
*/
70
59
public function testGetLabel (): void
@@ -77,7 +66,6 @@ public function testGetLabel(): void
77
66
}
78
67
79
68
/**
80
- * Tests the getExportJobStatus method.
81
69
* @covers ::getExportJobStatus
82
70
*/
83
71
public function testGetExportJobStatus (): void
@@ -90,50 +78,39 @@ public function testGetExportJobStatus(): void
90
78
}
91
79
92
80
/**
93
- * Tests the run method.
94
81
* @throws ExportException
95
82
* @covers ::run
96
83
*/
97
84
public function testRun (): void
98
85
{
99
- /* @var Dump&MockObject $dump */
100
86
$ dump = $ this ->createMock (Dump::class);
101
- /* @var Combination&MockObject $combination */
102
- $ combination = $ this ->createMock (Combination::class);
103
-
104
- /* @var ExportData&MockObject $exportData */
105
87
$ exportData = $ this ->createMock (ExportData::class);
106
- $ exportData ->expects ($ this ->any ())
107
- ->method ('getCombination ' )
108
- ->willReturn ($ combination );
109
88
110
89
$ data = new ProcessStepData ();
111
90
$ data ->setDump ($ dump )
112
91
->setExportData ($ exportData );
113
92
114
- /* @var ParserInterface&MockObject $parser1 */
115
93
$ parser1 = $ this ->createMock (ParserInterface::class);
116
94
$ parser1 ->expects ($ this ->once ())
117
95
->method ('prepare ' )
118
96
->with ($ this ->identicalTo ($ dump ));
119
97
$ parser1 ->expects ($ this ->once ())
120
98
->method ('parse ' )
121
- ->with ($ this ->identicalTo ($ dump ), $ this ->identicalTo ($ combination ));
99
+ ->with ($ this ->identicalTo ($ dump ), $ this ->identicalTo ($ exportData ));
122
100
$ parser1 ->expects ($ this ->once ())
123
101
->method ('validate ' )
124
- ->with ($ this ->identicalTo ($ combination ));
102
+ ->with ($ this ->identicalTo ($ exportData ));
125
103
126
- /* @var ParserInterface&MockObject $parser2 */
127
104
$ parser2 = $ this ->createMock (ParserInterface::class);
128
105
$ parser2 ->expects ($ this ->once ())
129
106
->method ('prepare ' )
130
107
->with ($ this ->identicalTo ($ dump ));
131
108
$ parser2 ->expects ($ this ->once ())
132
109
->method ('parse ' )
133
- ->with ($ this ->identicalTo ($ dump ), $ this ->identicalTo ($ combination ));
110
+ ->with ($ this ->identicalTo ($ dump ), $ this ->identicalTo ($ exportData ));
134
111
$ parser2 ->expects ($ this ->once ())
135
112
->method ('validate ' )
136
- ->with ($ this ->identicalTo ($ combination ));
113
+ ->with ($ this ->identicalTo ($ exportData ));
137
114
138
115
$ parsers = [$ parser1 , $ parser2 ];
139
116
0 commit comments