You are here

public function FedExRequestTest::testRateService in Commerce FedEx 8

@covers ::getRateService

File

tests/src/Unit/FedExRequestTest.php, line 56

Class

FedExRequestTest
Test Class for the Fedex Shipping Plugin.

Namespace

Drupal\Tests\commerce_fedex\Unit

Code

public function testRateService() {
  $rate_service = $this->request
    ->getRateService($this->configuration);
  $this
    ->assertInstanceOf("\\NicholasCreativeMedia\\FedExPHP\\Services\\RateService", $rate_service);

  /** @var \NicholasCreativeMedia\FedExPHP\Structs\VersionId $version */
  $version = $rate_service->version;
  $this
    ->assertInstanceOf("\\NicholasCreativeMedia\\FedExPHP\\Structs\\VersionId", $version);
  $this
    ->assertEquals(static::RATE_SERVICE_SERVICE_ID, $version
    ->getServiceId());
  $this
    ->assertEquals(static::RATE_SERVICE_MAJOR_VERSION, $version
    ->getMajor());
}