@@ -411,10 +411,23 @@ public function testLinkNotAvailable($messageType, $status, $notice)
411
411
*/
412
412
public function testContentDisposition ($ mimeType , $ disposition )
413
413
{
414
- $ this ->objectManager ->expects ($ this ->at ( 0 ))
414
+ $ this ->objectManager ->expects ($ this ->any ( ))
415
415
->method ('get ' )
416
- ->with (\Magento \Customer \Model \Session::class)
417
- ->willReturn ($ this ->session );
416
+ ->willReturnMap ([
417
+ [
418
+ \Magento \Customer \Model \Session::class,
419
+ $ this ->session ,
420
+ ],
421
+ [
422
+ \Magento \Downloadable \Helper \Data::class,
423
+ $ this ->helperData ,
424
+ ],
425
+ [
426
+ \Magento \Downloadable \Helper \Download::class,
427
+ $ this ->downloadHelper ,
428
+ ],
429
+ ]);
430
+
418
431
$ this ->request ->expects ($ this ->once ())->method ('getParam ' )->with ('id ' , 0 )->willReturn ('some_id ' );
419
432
$ this ->objectManager ->expects ($ this ->at (1 ))
420
433
->method ('create ' )
@@ -425,10 +438,6 @@ public function testContentDisposition($mimeType, $disposition)
425
438
->with ('some_id ' , 'link_hash ' )
426
439
->willReturnSelf ();
427
440
$ this ->linkPurchasedItem ->expects ($ this ->once ())->method ('getId ' )->willReturn (5 );
428
- $ this ->objectManager ->expects ($ this ->at (2 ))
429
- ->method ('get ' )
430
- ->with (\Magento \Downloadable \Helper \Data::class)
431
- ->willReturn ($ this ->helperData );
432
441
$ this ->helperData ->expects ($ this ->once ())
433
442
->method ('getIsShareable ' )
434
443
->with ($ this ->linkPurchasedItem )
@@ -442,10 +451,6 @@ public function testContentDisposition($mimeType, $disposition)
442
451
$ fileSize = 58493 ;
443
452
$ fileName = 'link.jpg ' ;
444
453
445
- $ this ->objectManager ->expects ($ this ->at (3 ))
446
- ->method ('get ' )
447
- ->with (\Magento \Downloadable \Helper \Download::class)
448
- ->willReturn ($ this ->downloadHelper );
449
454
$ this ->downloadHelper ->expects ($ this ->once ())
450
455
->method ('setResource ' )
451
456
->with ('link_url ' , 'url ' )
0 commit comments