Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/pod.git
<?php
require_once '../Order.php';

/**
 * Testable Order subclass that tracks processing.
 */
class TestableOrder extends Order {
  private bool $successful = false;

  protected function processResponse( array $response ): void {
    $this->successful = true;
    parent::processResponse( $response );
  }

  protected function processError( array $response, int $statusCode ): void {
    $this->successful = false;
    parent::processError( $response, $statusCode );
  }

  /**
   * Checks if processing was successful.
   *
   * @return bool True if processing was successful.
   */
  public function success(): bool {
    return $this->successful;
  }
}