Fix \Drupal calls should be avoided PayPlugTestService.php

Created on 8 July 2025, 7 days ago

Folowing #3519229 📌 Fix coding standards Active , there is still an error which would need some attention.

 ------ -------------------------------------------------------------------------- 
  Line   tests/modules/commerce_payplug_tests/src/Services/PayPlugTestService.php  
 ------ -------------------------------------------------------------------------- 
  94     \Drupal calls should be avoided in classes, use dependency                
         injection instead                                                         
 ------ -------------------------------------------------------------------------- 

Injecting the HTTP client via the addArgument() method in CommercePayplugTestsServiceProvider breaks tests with the following error.

1) Drupal\Tests\commerce_payplug\Functional\OffsitePayPlugPaymentGatewayTest::testCheckoutWithOffsiteRedirectPost
ArgumentCountError: Too few arguments to function Drupal\Core\Http\HandlerStackConfigurator::__construct(), 1 passed and exactly 2 expected
📌 Task
Status

Active

Version

5.0

Component

Code

Created by

🇫🇷France nicolasgraph Strasbourg

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024