Tests are failing on Drupal 11 / Commerce 3 with the following errors.
$this->entityTypeManager
is NULL
in OffsitePaymentGateway::validatePayment
.
Needs some more investigations.
PHPUnit 10.5.46 by Sebastian Bergmann and contributors.
Runtime: PHP 8.3.15
Configuration: /app/phpunit.xml
....E...EFFFF. 14 / 14 (100%)
Time: 00:48.286, Memory: 12.00 MB
There were 2 errors:
1) Drupal\Tests\commerce_alma\Kernel\OffsitePaymentGatewayTest::testOnNotify
Error: Call to a member function getStorage() on null
/app/web/modules/contrib/commerce_alma/src/Plugin/Commerce/PaymentGateway/OffsitePaymentGateway.php:343
/app/web/modules/contrib/commerce_alma/src/Plugin/Commerce/PaymentGateway/OffsitePaymentGateway.php:305
/app/web/modules/contrib/commerce_alma/tests/src/Kernel/OffsitePaymentGatewayTest.php:148
2) Drupal\Tests\commerce_alma\Kernel\OffsitePaymentGatewayTest::testValidatePayment
Error: Call to a member function getStorage() on null
/app/web/modules/contrib/commerce_alma/src/Plugin/Commerce/PaymentGateway/OffsitePaymentGateway.php:343
/app/web/modules/contrib/commerce_alma/tests/src/Kernel/OffsitePaymentGatewayTest.php:193
--
There were 4 failures:
1) Drupal\Tests\commerce_alma\Kernel\OffsitePaymentGatewayTest::testValidatePaymentException with data set "0" (Alma\API\Entities\Payment Object (...), [], [])
Failed asserting that exception of type "Error" matches expected exception "Drupal\commerce_payment\Exception\PaymentGatewayException". Message was: "Call to a member function getStorage() on null" at
/app/web/modules/contrib/commerce_alma/src/Plugin/Commerce/PaymentGateway/OffsitePaymentGateway.php:343
/app/web/modules/contrib/commerce_alma/tests/src/Kernel/OffsitePaymentGatewayTest.php:210
.
2) Drupal\Tests\commerce_alma\Kernel\OffsitePaymentGatewayTest::testValidatePaymentException with data set "1" (Alma\API\Entities\Payment Object (...), ['payment_default', 'offsite', '1234567890', 1, Drupal\commerce_price\Price Object (...), 'completed'], ['default', 1, [['default', 1, Drupal\commerce_price\Price Object (...)]]])
Failed asserting that exception of type "Error" matches expected exception "Drupal\commerce_payment\Exception\PaymentGatewayException". Message was: "Call to a member function getStorage() on null" at
/app/web/modules/contrib/commerce_alma/src/Plugin/Commerce/PaymentGateway/OffsitePaymentGateway.php:343
/app/web/modules/contrib/commerce_alma/tests/src/Kernel/OffsitePaymentGatewayTest.php:210
.
3) Drupal\Tests\commerce_alma\Kernel\OffsitePaymentGatewayTest::testValidatePaymentException with data set "2" (Alma\API\Entities\Payment Object (...), ['payment_default', 'offsite', '1234567890', Drupal\commerce_price\Price Object (...), 1], ['default', 1, [['default', 1, Drupal\commerce_price\Price Object (...)]]])
Failed asserting that exception of type "Error" matches expected exception "Drupal\commerce_payment\Exception\PaymentGatewayException". Message was: "Call to a member function getStorage() on null" at
/app/web/modules/contrib/commerce_alma/src/Plugin/Commerce/PaymentGateway/OffsitePaymentGateway.php:343
/app/web/modules/contrib/commerce_alma/tests/src/Kernel/OffsitePaymentGatewayTest.php:210
.
4) Drupal\Tests\commerce_alma\Kernel\OffsitePaymentGatewayTest::testValidatePaymentException with data set "3" (Alma\API\Entities\Payment Object (...), ['payment_default', 'offsite', '1234567890', Drupal\commerce_price\Price Object (...), 1], ['default', 1, [['default', 1, Drupal\commerce_price\Price Object (...)]]])
Failed asserting that exception of type "Error" matches expected exception "Drupal\commerce_payment\Exception\PaymentGatewayException". Message was: "Call to a member function getStorage() on null" at
/app/web/modules/contrib/commerce_alma/src/Plugin/Commerce/PaymentGateway/OffsitePaymentGateway.php:343
/app/web/modules/contrib/commerce_alma/tests/src/Kernel/OffsitePaymentGatewayTest.php:210
.
ERRORS!
Tests: 14, Assertions: 330, Errors: 2, Failures: 4, PHPUnit Deprecations: 1.