You are here

public function DeveloperAppUITest::testAppDefaultProducts in Apigee Edge 8

Creates an app with the default products.

File

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

Class

DeveloperAppUITest
Developer app UI tests.

Namespace

Drupal\Tests\apigee_edge\Functional

Code

public function testAppDefaultProducts() {
  $this->products[] = $this
    ->createProduct();
  $this->products[] = $this
    ->createProduct();
  $this
    ->submitAdminForm([
    'multiple_products' => TRUE,
    'user_select' => FALSE,
    "default_api_product_multiple[{$this->products[0]->getName()}]" => $this->products[0]
      ->getName(),
    "default_api_product_multiple[{$this->products[1]->getName()}]" => $this->products[1]
      ->getName(),
  ]);
  $asserts = function () {
    $this
      ->assertSession()
      ->pageTextContains($this->products[0]
      ->label());
    $this
      ->assertSession()
      ->pageTextContains($this->products[1]
      ->label());
    $this
      ->assertSession()
      ->pageTextNotContains($this->products[2]
      ->label());
  };
  $this
    ->assertAppCrud(NULL, $asserts, NULL, $asserts);
}