/** * @covers \Magento\BraintreeTwo\Block\Form::getCcAvailableTypes * @param string $countryId * @param array $availableTypes * @param array $expected * @dataProvider countryCardTypesDataProvider */ public function testGetCcAvailableTypes($countryId, array $availableTypes, array $expected) { $this->sessionQuote->expects(static::once())->method('getCountryId')->willReturn($countryId); $this->gatewayConfig->expects(static::once())->method('getAvailableCardTypes')->willReturn(self::$configCardTypes); $this->gatewayConfig->expects(static::once())->method('getCountryAvailableCardTypes')->with($countryId)->willReturn($availableTypes); $result = $this->block->getCcAvailableTypes(); static::assertEquals($expected, array_values($result)); }
public function testIsVaultEnabled() { $this->vaultService->expects(static::once())->method('isActiveForPayment')->with(ConfigProvider::CODE)->willReturn(true); static::assertTrue($this->block->isVaultEnabled()); }
/** * @param array $config * @param bool $expected * @covers \Magento\BraintreeTwo\Block\Form::isVaultEnabled * @dataProvider vaultConfigProvider */ public function testIsVaultEnabled(array $config, $expected) { $this->vaultConfigProvider->expects(static::once())->method('getConfig')->willReturn([VaultPaymentInterface::CODE => $config]); static::assertEquals($expected, $this->block->isVaultEnabled()); }