You are here

public function MollieApiMock::isExpired in Commerce Mollie 8

Mocks the isExpired() method for testing.

Return value

bool TRUE when order-total is 149.95 (5 x 29.99) USD.

1 call to MollieApiMock::isExpired()
MollieApiMock::__get in tests/modules/commerce_mollie_tests/src/Services/MollieApiMock.php
Magic method that passes every _get to the parent object.

File

tests/modules/commerce_mollie_tests/src/Services/MollieApiMock.php, line 200

Class

MollieApiMock
Mock class.

Namespace

Drupal\commerce_mollie_tests\Services

Code

public function isExpired() {

  /** @var \Drupal\commerce_order\Entity\Order $commerce_order */
  $commerce_order = $this->commerceOrderStorage
    ->load(1);

  /** @var \Drupal\commerce_price\Price $balance */
  $balance = $commerce_order
    ->getBalance();
  return $balance
    ->getNumber() === '149.95';
}