You are here

public function MollieApiMock::isPaid in Commerce Mollie 8

Mocks the isPaid() method for testing.

Return value

bool TRUE when order-total is 29.99 USD.

1 call to MollieApiMock::isPaid()
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 144

Class

MollieApiMock
Mock class.

Namespace

Drupal\commerce_mollie_tests\Services

Code

public function isPaid() {

  /** @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() === '29.99';
}