You are here

public function MollieApiMock::isOpen in Commerce Mollie 8

Mocks the isOpen() method for testing.

Return value

bool TRUE when order-total is 89.97 (3 x 29.99) USD.

1 call to MollieApiMock::isOpen()
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 172

Class

MollieApiMock
Mock class.

Namespace

Drupal\commerce_mollie_tests\Services

Code

public function isOpen() {

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