12 use PHPUnit_Framework_MockObject_MockObject as MockObject;
19 private $paymentTokenManagement;
24 private $customerSession;
29 private $tokenManagement;
33 $this->paymentTokenManagement = $this->getMockBuilder(PaymentTokenManagement::class)
34 ->disableOriginalConstructor()
36 $this->customerSession = $this->getMockBuilder(Session::class)
37 ->disableOriginalConstructor()
41 $this->paymentTokenManagement,
42 $this->customerSession
54 $this->customerSession->method(
'getCustomerId')->willReturn(
$customerId);
55 $this->customerSession->method(
'isLoggedIn')->willReturn($isLoggedCustomer);
56 $this->paymentTokenManagement->expects(static::never())->method(
'getVisibleAvailableTokens');
58 static::assertEquals([], $this->tokenManagement->getCustomerSessionTokens());
67 'not registered customer' => [
null,
false],
68 'not logged in customer' => [1,
false],
75 $token = $this->createMock(PaymentTokenInterface::class);
78 $this->customerSession->expects(static::once())
79 ->method(
'getCustomerId')
82 $this->customerSession->expects(static::once())
83 ->method(
'isLoggedIn')
86 $this->paymentTokenManagement->expects(static::once())
87 ->method(
'getVisibleAvailableTokens')
89 ->willReturn($expectation);
93 $this->tokenManagement->getCustomerSessionTokens()
testGetCustomerSessionTokens()
getCustomerSessionTokensNegativeDataProvider()
testGetCustomerSessionTokensNegative($customerId, bool $isLoggedCustomer)