@@ -382,11 +382,13 @@ public function testGetStepData()
382
382
*/
383
383
public function testGetQuote (): void
384
384
{
385
- $ quoteRepository = $ this ->createMock (\Magento \Quote \Api \CartRepositoryInterface::class);
386
385
$ storeManager = $ this ->getMockForAbstractClass (\Magento \Store \Model \StoreManagerInterface::class);
387
386
$ customerSession = $ this ->createMock (\Magento \Customer \Model \Session::class);
387
+ $ quoteRepository = $ this ->createMock (\Magento \Quote \Api \CartRepositoryInterface::class);
388
388
$ quoteFactory = $ this ->createMock (\Magento \Quote \Model \QuoteFactory::class);
389
389
$ quote = $ this ->createMock (\Magento \Quote \Model \Quote::class);
390
+ $ logger = $ this ->createMock (\Psr \Log \LoggerInterface::class);
391
+ $ loggerMethods = get_class_methods (\Psr \Log \LoggerInterface::class);
390
392
391
393
$ quoteFactory ->expects ($ this ->once ())
392
394
->method ('create ' )
@@ -403,14 +405,19 @@ public function testGetQuote(): void
403
405
->will ($ this ->returnValue ($ store ));
404
406
$ storage = $ this ->getMockBuilder (\Magento \Framework \Session \Storage::class)
405
407
->disableOriginalConstructor ()
406
- ->setMethods (['setData ' , 'getData ' ])
408
+ ->setMethods (['setData ' , 'getData ' ])
407
409
->getMock ();
408
410
$ storage ->expects ($ this ->at (0 ))
409
411
->method ('getData ' )
410
412
->willReturn (1 );
411
413
$ quoteRepository ->expects ($ this ->once ())
412
414
->method ('getActiveForCustomer ' )
413
- ->willThrowException (new NoSuchEntityException ());
415
+ ->willThrowException (new NoSuchEntityException ());
416
+
417
+ foreach ($ loggerMethods as $ method ) {
418
+ $ logger ->expects ($ this ->never ())->method ($ method );
419
+ }
420
+
414
421
$ quote ->expects ($ this ->once ())
415
422
->method ('setCustomer ' )
416
423
->with (null );
@@ -422,7 +429,8 @@ public function testGetQuote(): void
422
429
'quoteRepository ' => $ quoteRepository ,
423
430
'customerSession ' => $ customerSession ,
424
431
'storage ' => $ storage ,
425
- 'quoteFactory ' => $ quoteFactory
432
+ 'quoteFactory ' => $ quoteFactory ,
433
+ 'logger ' => $ logger
426
434
]
427
435
);
428
436
$ this ->_session = $ this ->_helper ->getObject (\Magento \Checkout \Model \Session::class, $ constructArguments );
0 commit comments