You are here

protected function DeveloperAppUITestTrait::assertDeveloperAppExists in Apigee Edge 8

Asserts that a certain app exists.

Parameters

string $name: Name of the app.

Return value

\Drupal\apigee_edge\Entity\DeveloperAppInterface|null Developer app or null.

2 calls to DeveloperAppUITestTrait::assertDeveloperAppExists()
DeveloperAppUITest::testCreateDuplicateApps in tests/src/Functional/DeveloperAppUITest.php
Tests that apps with the same name and developer can't be created.
DeveloperAppUITestTrait::assertAppCreationWithProduct in tests/src/Functional/DeveloperAppUITestTrait.php
Creates an app and assigns products to it.

File

tests/src/Functional/DeveloperAppUITestTrait.php, line 166

Class

DeveloperAppUITestTrait
Contains re-usable components for developer app UI tests.

Namespace

Drupal\Tests\apigee_edge\Functional

Code

protected function assertDeveloperAppExists(string $name) : ?DeveloperAppInterface {

  /** @var \Drupal\apigee_edge\Entity\DeveloperAppInterface[] $apps */
  $apps = $this
    ->getApps();
  $found = NULL;
  foreach ($apps as $app) {
    if ($app
      ->getName() === $name) {
      $found = $app;
      break;
    }
  }
  $this
    ->assertNotNull($found, 'Developer app name found.');
  return $found;
}