@@ -77,12 +77,13 @@ public function testGetErrorHandler()
77
77
78
78
$ this ->appStateMock ->expects ($ this ->once ())->method ('getAreaCode ' )->willReturn (Area::AREA_FRONTEND );
79
79
80
- $ this ->scopeConfigMock ->expects ($ this ->exactly (2 ))->method ('getValue ' )
81
- ->withConsecutive (
82
- [Config::CONFIG_ENABLED , ScopeConfigInterface::SCOPE_TYPE_DEFAULT ],
83
- [Config::CONFIG_ERROR_HANDLER , ScopeConfigInterface::SCOPE_TYPE_DEFAULT ]
84
- )
85
- ->willReturnOnConsecutiveCalls (true , ErrorHandler::WHOOPS );
80
+ $ this ->scopeConfigMock ->expects ($ this ->once ())->method ('isSetFlag ' )
81
+ ->with (Config::CONFIG_ENABLED , ScopeConfigInterface::SCOPE_TYPE_DEFAULT )
82
+ ->willReturn (true );
83
+
84
+ $ this ->scopeConfigMock ->expects ($ this ->once ())->method ('getValue ' )
85
+ ->with (Config::CONFIG_ERROR_HANDLER , ScopeConfigInterface::SCOPE_TYPE_DEFAULT )
86
+ ->willReturn (ErrorHandler::WHOOPS );
86
87
87
88
$ this ->assertEquals (ErrorHandler::WHOOPS , $ this ->config ->getErrorHandler ());
88
89
}
@@ -95,9 +96,9 @@ public function testGetErrorHandlerDefault()
95
96
96
97
public function testIsDatabaseCollectorEnabled ()
97
98
{
98
- $ this ->scopeConfigMock ->expects ($ this ->once ())->method ('getValue ' )
99
+ $ this ->scopeConfigMock ->expects ($ this ->once ())->method ('isSetFlag ' )
99
100
->with (Config::CONFIG_COLLECTOR_DATABASE , ScopeConfigInterface::SCOPE_TYPE_DEFAULT )
100
- ->willReturn (' 1 ' );
101
+ ->willReturn (true );
101
102
102
103
$ this ->deploymentConfigMock ->expects ($ this ->once ())->method ('get ' )
103
104
->with ('db/connection/default/profiler/enabled ' )
@@ -108,49 +109,49 @@ public function testIsDatabaseCollectorEnabled()
108
109
109
110
public function testIsAjaxCollectorEnabled ()
110
111
{
111
- $ this ->scopeConfigMock ->expects ($ this ->once ())->method ('getValue ' )
112
+ $ this ->scopeConfigMock ->expects ($ this ->once ())->method ('isSetFlag ' )
112
113
->with (Config::CONFIG_COLLECTOR_AJAX , ScopeConfigInterface::SCOPE_TYPE_DEFAULT )
113
- ->willReturn (' 1 ' );
114
+ ->willReturn (true );
114
115
$ this ->assertTrue ($ this ->config ->isAjaxCollectorEnabled ());
115
116
}
116
117
117
118
public function testIsAdminhtmlActive ()
118
119
{
119
- $ this ->scopeConfigMock ->expects ($ this ->once ())->method ('getValue ' )
120
+ $ this ->scopeConfigMock ->expects ($ this ->once ())->method ('isSetFlag ' )
120
121
->with (Config::CONFIG_ENABLED_ADMINHTML , ScopeConfigInterface::SCOPE_TYPE_DEFAULT )
121
- ->willReturn (' 1 ' );
122
+ ->willReturn (true );
122
123
$ this ->assertTrue ($ this ->config ->isAdminhtmlActive ());
123
124
}
124
125
125
126
public function testIsConfigCollectorEnabled ()
126
127
{
127
- $ this ->scopeConfigMock ->expects ($ this ->once ())->method ('getValue ' )
128
+ $ this ->scopeConfigMock ->expects ($ this ->once ())->method ('isSetFlag ' )
128
129
->with (Config::CONFIG_COLLECTOR_CONFIG , ScopeConfigInterface::SCOPE_TYPE_DEFAULT )
129
- ->willReturn (' 1 ' );
130
+ ->willReturn (true );
130
131
$ this ->assertTrue ($ this ->config ->isConfigCollectorEnabled ());
131
132
}
132
133
133
134
public function testIsModelCollectorEnabled ()
134
135
{
135
- $ this ->scopeConfigMock ->expects ($ this ->once ())->method ('getValue ' )
136
+ $ this ->scopeConfigMock ->expects ($ this ->once ())->method ('isSetFlag ' )
136
137
->with (Config::CONFIG_COLLECTOR_MODEL , ScopeConfigInterface::SCOPE_TYPE_DEFAULT )
137
- ->willReturn (' 1 ' );
138
+ ->willReturn (true );
138
139
$ this ->assertTrue ($ this ->config ->isModelCollectorEnabled ());
139
140
}
140
141
141
142
public function testIsPluginCollectorEnabled ()
142
143
{
143
- $ this ->scopeConfigMock ->expects ($ this ->once ())->method ('getValue ' )
144
+ $ this ->scopeConfigMock ->expects ($ this ->once ())->method ('isSetFlag ' )
144
145
->with (Config::CONFIG_COLLECTOR_PLUGIN , ScopeConfigInterface::SCOPE_TYPE_DEFAULT )
145
- ->willReturn (' 1 ' );
146
+ ->willReturn (true );
146
147
$ this ->assertTrue ($ this ->config ->isPluginCollectorEnabled ());
147
148
}
148
149
149
150
public function testIsTranslationCollectorEnabled ()
150
151
{
151
- $ this ->scopeConfigMock ->expects ($ this ->once ())->method ('getValue ' )
152
+ $ this ->scopeConfigMock ->expects ($ this ->once ())->method ('isSetFlag ' )
152
153
->with (Config::CONFIG_COLLECTOR_TRANSLATION , ScopeConfigInterface::SCOPE_TYPE_DEFAULT )
153
- ->willReturn (' 1 ' );
154
+ ->willReturn (true );
154
155
$ this ->assertTrue ($ this ->config ->isTranslationCollectorEnabled ());
155
156
}
156
157
@@ -164,44 +165,44 @@ public function testGetCollectors()
164
165
165
166
public function testIsLayoutCollectorEnabled ()
166
167
{
167
- $ this ->scopeConfigMock ->expects ($ this ->once ())->method ('getValue ' )
168
+ $ this ->scopeConfigMock ->expects ($ this ->once ())->method ('isSetFlag ' )
168
169
->with (Config::CONFIG_COLLECTOR_LAYOUT , ScopeConfigInterface::SCOPE_TYPE_DEFAULT )
169
- ->willReturn (' 1 ' );
170
+ ->willReturn (true );
170
171
$ this ->assertTrue ($ this ->config ->isLayoutCollectorEnabled ());
171
172
}
172
173
173
174
public function testIsMemoryCollectorEnabled ()
174
175
{
175
- $ this ->scopeConfigMock ->expects ($ this ->once ())->method ('getValue ' )
176
+ $ this ->scopeConfigMock ->expects ($ this ->once ())->method ('isSetFlag ' )
176
177
->with (Config::CONFIG_COLLECTOR_MEMORY , ScopeConfigInterface::SCOPE_TYPE_DEFAULT )
177
- ->willReturn (' 1 ' );
178
+ ->willReturn (true );
178
179
$ this ->assertTrue ($ this ->config ->isMemoryCollectorEnabled ());
179
180
}
180
181
181
182
public function testIsCustomerCollectorEnabled ()
182
183
{
183
- $ this ->scopeConfigMock ->expects ($ this ->once ())->method ('getValue ' )
184
+ $ this ->scopeConfigMock ->expects ($ this ->once ())->method ('isSetFlag ' )
184
185
->with (Config::CONFIG_COLLECTOR_CUSTOMER , ScopeConfigInterface::SCOPE_TYPE_DEFAULT )
185
- ->willReturn (' 1 ' );
186
+ ->willReturn (true );
186
187
$ this ->assertTrue ($ this ->config ->isCustomerCollectorEnabled ());
187
188
}
188
189
189
190
public function testIsEnabledNotActive ()
190
191
{
191
192
$ this ->appStateMock ->expects ($ this ->once ())->method ('getMode ' )->willReturn (State::MODE_DEVELOPER );
192
- $ this ->scopeConfigMock ->expects ($ this ->once ())->method ('getValue ' )
193
+ $ this ->scopeConfigMock ->expects ($ this ->once ())->method ('isSetFlag ' )
193
194
->with (Config::CONFIG_ENABLED , ScopeConfigInterface::SCOPE_TYPE_DEFAULT )
194
- ->willReturn (' 0 ' );
195
+ ->willReturn (false );
195
196
$ this ->assertFalse ($ this ->config ->isEnabled ());
196
197
}
197
198
198
199
public function testIsDisabledForAdminhtml ()
199
200
{
200
- $ this ->scopeConfigMock ->expects ($ this ->exactly (2 ))->method ('getValue ' )
201
+ $ this ->scopeConfigMock ->expects ($ this ->exactly (2 ))->method ('isSetFlag ' )
201
202
->withConsecutive (
202
203
[Config::CONFIG_ENABLED , ScopeConfigInterface::SCOPE_TYPE_DEFAULT ],
203
204
[Config::CONFIG_ENABLED_ADMINHTML , ScopeConfigInterface::SCOPE_TYPE_DEFAULT ]
204
- )->willReturnOnConsecutiveCalls (' 1 ' , ' 0 ' );
205
+ )->willReturnOnConsecutiveCalls (true , false );
205
206
$ this ->appStateMock ->expects ($ this ->once ())->method ('getMode ' )->willReturn (State::MODE_DEVELOPER );
206
207
$ this ->appStateMock ->expects ($ this ->once ())->method ('getAreaCode ' )->willReturn (Area::AREA_ADMINHTML );
207
208
$ this ->assertFalse ($ this ->config ->isEnabled ());
@@ -218,9 +219,9 @@ public function testIsAllowedIP()
218
219
219
220
public function testIsTimeCollectorEnabled ()
220
221
{
221
- $ this ->scopeConfigMock ->expects ($ this ->once ())->method ('getValue ' )
222
+ $ this ->scopeConfigMock ->expects ($ this ->once ())->method ('isSetFlag ' )
222
223
->with (Config::CONFIG_COLLECTOR_TIME , ScopeConfigInterface::SCOPE_TYPE_DEFAULT )
223
- ->willReturn (' 1 ' );
224
+ ->willReturn (true );
224
225
$ this ->assertTrue ($ this ->config ->isTimeCollectorEnabled ());
225
226
}
226
227
@@ -269,25 +270,25 @@ public function testGetCollectorClassNotFound()
269
270
270
271
public function testIsCacheCollectorEnabled ()
271
272
{
272
- $ this ->scopeConfigMock ->expects ($ this ->once ())->method ('getValue ' )
273
+ $ this ->scopeConfigMock ->expects ($ this ->once ())->method ('isSetFlag ' )
273
274
->with (Config::CONFIG_COLLECTOR_CACHE , ScopeConfigInterface::SCOPE_TYPE_DEFAULT )
274
- ->willReturn (' 1 ' );
275
+ ->willReturn (true );
275
276
$ this ->assertTrue ($ this ->config ->isCacheCollectorEnabled ());
276
277
}
277
278
278
279
public function testIsEventCollectorEnabled ()
279
280
{
280
- $ this ->scopeConfigMock ->expects ($ this ->once ())->method ('getValue ' )
281
+ $ this ->scopeConfigMock ->expects ($ this ->once ())->method ('isSetFlag ' )
281
282
->with (Config::CONFIG_COLLECTOR_EVENT , ScopeConfigInterface::SCOPE_TYPE_DEFAULT )
282
- ->willReturn (' 1 ' );
283
+ ->willReturn (true );
283
284
$ this ->assertTrue ($ this ->config ->isEventCollectorEnabled ());
284
285
}
285
286
286
287
public function testIsActive ()
287
288
{
288
- $ this ->scopeConfigMock ->expects ($ this ->once ())->method ('getValue ' )
289
+ $ this ->scopeConfigMock ->expects ($ this ->once ())->method ('isSetFlag ' )
289
290
->with (Config::CONFIG_ENABLED , ScopeConfigInterface::SCOPE_TYPE_DEFAULT )
290
- ->willReturn (' 0 ' );
291
+ ->willReturn (false );
291
292
$ this ->assertFalse ($ this ->config ->isActive ());
292
293
}
293
294
0 commit comments