You are here

public function AcquiaConnectorUnitTest::testIdFromSub in Acquia Connector 8

Same name and namespace in other branches
  1. 8.2 tests/src/Unit/AcquiaConnectorUnitTest.php \Drupal\Tests\acquia_connector\Unit\AcquiaConnectorUnitTest::testIdFromSub()
  2. 3.x tests/src/Unit/AcquiaConnectorUnitTest.php \Drupal\Tests\acquia_connector\Unit\AcquiaConnectorUnitTest::testIdFromSub()

Test Id From Subscription.

File

tests/src/Unit/AcquiaConnectorUnitTest.php, line 65
Contains \Drupal\Tests\acquia_connector\Unit\AcquiaConnectorUnitTest.

Class

AcquiaConnectorUnitTest
@coversDefaultClass \Drupal\acquia_connector\Client

Namespace

Drupal\Tests\acquia_connector\Unit

Code

public function testIdFromSub() {
  $statusController = new StatusControllerTest();
  $uuid = $statusController
    ->getIdFromSub([
    'uuid' => 'test',
  ]);
  $this
    ->assertEquals('test', $uuid, 'UUID property identical');
  $data = [
    'href' => 'http://example.com/network/uuid/test/dashboard',
  ];
  $uuid = $statusController
    ->getIdFromSub($data);
  $this
    ->assertEquals('test', $uuid, 'UUID extracted from href');
}