diff --git a/Tests/Unit/Model/Methods/AbstractMethodTest.php b/Tests/Unit/Model/Methods/AbstractMethodTest.php index 62335ec40bf..05473765f0c 100644 --- a/Tests/Unit/Model/Methods/AbstractMethodTest.php +++ b/Tests/Unit/Model/Methods/AbstractMethodTest.php @@ -7,7 +7,6 @@ use Mollie\Api\Resources\Method; use Mollie\Api\Endpoints\MethodEndpoint; use Mollie\Api\Resources\MethodCollection; -use Mollie\Payment\Model\Methods\ApplePay; use Mollie\Payment\Model\MollieConfigProvider; use Mollie\Payment\Helper\General as MollieHelper; use Magento\Framework\App\Config\ScopeConfigInterface; @@ -53,7 +52,7 @@ public function testHasTheCorrectCode() $reflection = new \ReflectionClass($this->instance); $instance = $reflection->newInstanceWithoutConstructor(); - $this->assertEquals($this->code, $instance->getCode()); + $this->assertEquals('mollie_methods_' . $this->code, $instance->getCode()); } public function testIsListedAsActiveMethod() @@ -72,14 +71,19 @@ public function testIsListedAsActiveMethod() $methods = $helper->getAllActiveMethods(1); - $this->assertArrayHasKey($this->code, $methods); + if ($this->code == 'paymentlink') { + $this->assertArrayNotHasKey('mollie_methods_' . $this->code, $methods); + return; + } + + $this->assertArrayHasKey('mollie_methods_' . $this->code, $methods); } public function testThatTheMethodIsActive() { /** @var Method $method */ $method = $this->objectManager->getObject(Method::class); - $method->id = 'applepay'; + $method->id = $this->code; $method->image = new \stdClass; $method->image->size2x = 'http://www.example.com/image.png'; @@ -95,6 +99,7 @@ public function testThatTheMethodIsActive() $instance = $this->objectManager->getObject(MollieConfigProvider::class); $methods = $instance->getActiveMethods($mollieApiClient); - $this->assertArrayHasKey($this->code, $methods); + $this->assertArrayHasKey('mollie_methods_' . $this->code, $methods); + $this->assertEquals($method->image->size2x, $methods['mollie_methods_' . $this->code]['image']); } } \ No newline at end of file diff --git a/Tests/Unit/Model/Methods/ApplePayTest.php b/Tests/Unit/Model/Methods/ApplePayTest.php index 27398b5129c..be490ea1227 100644 --- a/Tests/Unit/Model/Methods/ApplePayTest.php +++ b/Tests/Unit/Model/Methods/ApplePayTest.php @@ -11,7 +11,7 @@ class ApplePayTest extends AbstractMethodTest { protected $instance = ApplePay::class; - protected $code = 'mollie_methods_applepay'; + protected $code = 'applepay'; public function testTheIncludeWalletsParameterIsUsed() { diff --git a/Tests/Unit/Model/Methods/BancontactTest.php b/Tests/Unit/Model/Methods/BancontactTest.php new file mode 100644 index 00000000000..2bc03c7f25e --- /dev/null +++ b/Tests/Unit/Model/Methods/BancontactTest.php @@ -0,0 +1,12 @@ +