You are here

public function DeveloperAppUITest::testCreateDuplicateApps in Apigee Edge 8

Tests that apps with the same name and developer can't be created.

File

tests/src/Functional/DeveloperAppUITest.php, line 181

Class

DeveloperAppUITest
Developer app UI tests.

Namespace

Drupal\Tests\apigee_edge\Functional

Code

public function testCreateDuplicateApps() {
  $name = strtolower($this
    ->randomMachineName());
  $this
    ->postCreateAppForm([
    'name' => $name,
    'displayName[0][value]' => $name,
    "api_products[{$this->products[0]->getName()}]" => $this->products[0]
      ->getName(),
  ]);
  $this
    ->assertDeveloperAppExists($name);
  $this
    ->postCreateAppForm([
    'name' => $name,
    'displayName[0][value]' => $name,
  ]);
  $this
    ->assertSession()
    ->pageTextContains(static::DUPLICATE_MACHINE_NAME);
}