@@ 300-321 (lines=22) @@ | ||
297 | * |
|
298 | * @return Mock[]|SectionModel[] |
|
299 | */ |
|
300 | private function getMockSections($indexBy, $count) |
|
301 | { |
|
302 | $keyPrefix = $indexBy == 'id' ? '' : 'sectionHandle'; |
|
303 | $mockSections = []; |
|
304 | for ($x = 0; $x <= $count; $x++) { |
|
305 | $mockSection = $this->getMockBuilder(SectionModel::class) |
|
306 | ->disableOriginalConstructor() |
|
307 | ->getMock(); |
|
308 | ||
309 | $mockSection->expects($this->any()) |
|
310 | ->method('__get') |
|
311 | ->willReturnMap([ |
|
312 | ['handle', 'sectionHandle'.$x], |
|
313 | ['id', $x], |
|
314 | ['name', 'sectionName'.$x], |
|
315 | ]); |
|
316 | ||
317 | $mockSections[$keyPrefix.$x] = $mockSection; |
|
318 | } |
|
319 | ||
320 | return $mockSections; |
|
321 | } |
|
322 | ||
323 | /** |
|
324 | * @param string $indexBy |
|
@@ 350-371 (lines=22) @@ | ||
347 | * |
|
348 | * @return Mock[]|AssetSourceModel[] |
|
349 | */ |
|
350 | private function getMockAssetSources($indexBy, $count) |
|
351 | { |
|
352 | $keyPrefix = $indexBy == 'id' ? '' : 'assetSourceHandle'; |
|
353 | $mockAssetSources = []; |
|
354 | for ($x = 0; $x <= $count; $x++) { |
|
355 | $mockAssetSource = $this->getMockBuilder(AssetSourceModel::class) |
|
356 | ->disableOriginalConstructor() |
|
357 | ->getMock(); |
|
358 | ||
359 | $mockAssetSource->expects($this->any()) |
|
360 | ->method('__get') |
|
361 | ->willReturnMap([ |
|
362 | ['handle', 'assetSourceHandle'.$x], |
|
363 | ['id', $x], |
|
364 | ['name', 'assetSourceName'.$x], |
|
365 | ]); |
|
366 | ||
367 | $mockAssetSources[$keyPrefix.$x] = $mockAssetSource; |
|
368 | } |
|
369 | ||
370 | return $mockAssetSources; |
|
371 | } |
|
372 | ||
373 | /** |
|
374 | * @param string $indexBy |
|
@@ 400-421 (lines=22) @@ | ||
397 | * |
|
398 | * @return Mock[]|GlobalSetModel[] |
|
399 | */ |
|
400 | private function getMockGlobalSets($indexBy, $count) |
|
401 | { |
|
402 | $keyPrefix = $indexBy == 'id' ? '' : 'globalSetHandle'; |
|
403 | $mockGlobalSets = []; |
|
404 | for ($x = 0; $x <= $count; $x++) { |
|
405 | $mockGlobalSet = $this->getMockBuilder(GlobalSetModel::class) |
|
406 | ->disableOriginalConstructor() |
|
407 | ->getMock(); |
|
408 | ||
409 | $mockGlobalSet->expects($this->any()) |
|
410 | ->method('__get') |
|
411 | ->willReturnMap([ |
|
412 | ['handle', 'globalSetHandle'.$x], |
|
413 | ['id', $x], |
|
414 | ['name', 'globalSetName'.$x], |
|
415 | ]); |
|
416 | ||
417 | $mockGlobalSets[$keyPrefix.$x] = $mockGlobalSet; |
|
418 | } |
|
419 | ||
420 | return $mockGlobalSets; |
|
421 | } |
|
422 | ||
423 | /** |
|
424 | * @param bool $success |