You are here

public function DeveloperAppUITest::testFieldValidationConstraints in Apigee Edge 8

Tests that field validation constraints are executed on form save.

@covers \Drupal\apigee_edge\Entity\Form\FieldableEdgeEntityForm::validateForm

File

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

Class

DeveloperAppUITest
Developer app UI tests.

Namespace

Drupal\Tests\apigee_edge\Functional

Code

public function testFieldValidationConstraints() {

  /* @see \Drupal\apigee_edge_test\Entity\OverriddenDeveloperApp::baseFieldDefinitions() */
  $name = strtolower($this
    ->randomMachineName(31));
  $this
    ->postCreateAppForm([
    'name' => $name,
    'displayName[0][value]' => $name,
    "api_products[{$this->products[0]->getName()}]" => $this->products[0]
      ->getName(),
  ]);
  $this
    ->assertSession()
    ->pageTextContains('This value is too long. It should have 30 characters or less.');
}