File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
lib/internal/Magento/Framework/View/Test/Unit Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 11
11
use Magento \Framework \App \AreaList ;
12
12
use Magento \Framework \App \Request \Http ;
13
13
use Magento \Framework \App \State ;
14
+ use Magento \Framework \View \DesignLoader ;
14
15
use PHPUnit \Framework \MockObject \MockObject ;
15
16
use PHPUnit \Framework \TestCase ;
16
17
17
18
class DesignLoaderTest extends TestCase
18
19
{
20
+ /**
21
+ * @var DesignLoader
22
+ */
23
+ protected $ _model ;
24
+
19
25
/**
20
26
* @var MockObject
21
27
*/
@@ -39,6 +45,11 @@ protected function setUp(): void
39
45
$ this ->_areaListMock = $ this ->createMock (AreaList::class);
40
46
$ this ->_requestMock = $ this ->createMock (Http::class);
41
47
$ this ->appState = $ this ->createMock (State::class);
48
+ $ this ->_model = new DesignLoader (
49
+ $ this ->_requestMock ,
50
+ $ this ->_areaListMock ,
51
+ $ this ->appState
52
+ );
42
53
}
43
54
44
55
/**
@@ -51,7 +62,8 @@ public function testLoad(): void
51
62
$ this ->_areaListMock ->expects ($ this ->once ())->method ('getArea ' )->with ('area ' )->willReturn ($ area );
52
63
$ area
53
64
->method ('load ' )
54
- ->withConsecutive ([Area::PART_DESIGN ])
55
- ->willReturnOnConsecutiveCalls ($ area );
65
+ ->withConsecutive ([Area::PART_DESIGN ], [Area::PART_TRANSLATE ])
66
+ ->willReturnOnConsecutiveCalls ($ area , $ area );
67
+ $ this ->_model ->load ($ this ->_requestMock );
56
68
}
57
69
}
You can’t perform that action at this time.
0 commit comments