diff --git a/Test/Unit/Gateway/Transaction/GooglePay/Config/ConfigTest.php b/Test/Unit/Gateway/Transaction/GooglePay/Config/ConfigTest.php new file mode 100644 index 00000000..e0d087c4 --- /dev/null +++ b/Test/Unit/Gateway/Transaction/GooglePay/Config/ConfigTest.php @@ -0,0 +1,37 @@ +makePartial(['getConfig']); + $config->shouldAllowMockingProtectedMethods(); + $config->shouldReceive('getConfig')->andReturn('visa'); + $allowedBrands = $config->getCardBrands(); + $this->assertIsArray($allowedBrands); + $this->assertEquals(['VISA'], $allowedBrands); + } + public function testGetCardBrandsIfTwoBrandsActives() + { + $config = \Mockery::mock(Config::class)->makePartial(['getConfig']); + $config->shouldAllowMockingProtectedMethods(); + $config->shouldReceive('getConfig')->andReturn('visa,mastercard'); + $allowedBrands = $config->getCardBrands(); + $this->assertIsArray($allowedBrands); + $this->assertEquals(['VISA', 'MASTERCARD'], $allowedBrands); + } + + public function testGetCardBrandsWithBrandNotAllowedForGooglePay() + { + $config = \Mockery::mock(Config::class)->makePartial(['getConfig']); + $config->shouldAllowMockingProtectedMethods(); + $config->shouldReceive('getConfig')->andReturn('visa,jcb'); + $allowedBrands = $config->getCardBrands(); + $this->assertIsArray($allowedBrands); + $this->assertEquals(['VISA'], $allowedBrands); + } +}