@@ -55,16 +55,42 @@ public function setUp()
55
55
56
56
public function testBeforeDispatch ()
57
57
{
58
- $ theme = $ this ->getMock ('Magento\Theme\Model\Theme ' , [], [], '' , false );
58
+ $ theme = $ this ->getMock (
59
+ 'Magento\Theme\Model\Theme ' ,
60
+ [
61
+ 'setParentId ' ,
62
+ 'getArea ' ,
63
+ 'getThemePath ' ,
64
+ 'getParentTheme ' ,
65
+ 'getId ' ,
66
+ 'getFullPath ' ,
67
+ 'toArray ' ,
68
+ 'addData ' ,
69
+ 'save ' ,
70
+ ],
71
+ [],
72
+ '' ,
73
+ false
74
+ );
59
75
$ this ->appState ->expects ($ this ->once ())->method ('getMode ' )->willReturn ('default ' );
60
76
$ this ->themeRegistration ->expects ($ this ->once ())->method ('register ' );
61
77
$ this ->themeCollection ->expects ($ this ->once ())->method ('loadData ' )->willReturn ([$ theme ]);
62
78
$ theme ->expects ($ this ->once ())->method ('getArea ' )->willReturn ('frontend ' );
63
79
$ theme ->expects ($ this ->once ())->method ('getThemePath ' )->willReturn ('Magento/luma ' );
64
- $ this ->themeLoader ->expects ($ this ->once ())
80
+ $ theme ->expects ($ this ->exactly (2 ))->method ('getParentTheme ' )->willReturnSelf ();
81
+ $ theme ->expects ($ this ->once ())->method ('getId ' )->willReturn (1 );
82
+ $ theme ->expects ($ this ->once ())->method ('getFullPath ' )->willReturn ('frontend/Magento/blank ' );
83
+ $ theme ->expects ($ this ->once ())->method ('setParentId ' )->with (1 );
84
+ $ this ->themeLoader ->expects ($ this ->exactly (2 ))
65
85
->method ('getThemeByFullPath ' )
66
- ->with ('frontend/Magento/luma ' )
67
- ->willReturn ($ theme );
86
+ ->withConsecutive (
87
+ ['frontend/Magento/blank ' ],
88
+ ['frontend/Magento/luma ' ]
89
+ )
90
+ ->will ($ this ->onConsecutiveCalls (
91
+ $ theme ,
92
+ $ theme
93
+ ));
68
94
$ theme ->expects ($ this ->once ())
69
95
->method ('toArray ' )
70
96
->willReturn ([
0 commit comments