You are here

public function MollieApiMock::isFailed in Commerce Mollie 8

Mocks the isFailed() method for testing.

Return value

bool TRUE when order-total is 119.96 (4 x 29.99) USD.

1 call to MollieApiMock::isFailed()
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 186

Class

MollieApiMock
Mock class.

Namespace

Drupal\commerce_mollie_tests\Services

Code

public function isFailed() {

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