public function DeveloperAppUITest::testAppCrudSingleProductChange in Apigee Edge 8
Creates an app with a single product and then removes the product.
File
- tests/
src/ Functional/ DeveloperAppUITest.php, line 333
Class
- DeveloperAppUITest
- Developer app UI tests.
Namespace
Drupal\Tests\apigee_edge\FunctionalCode
public function testAppCrudSingleProductChange() {
$this
->submitAdminForm([
'display_as_select' => TRUE,
'multiple_products' => FALSE,
]);
$this->products[] = $this
->createProduct();
$this
->assertAppCrud(function (array $data) : array {
$data['api_products'] = $this->products[0]
->getName();
return $data;
}, function () {
$this
->assertSession()
->pageTextContains($this->products[0]
->label());
}, function (array $data, string $credential_id) : array {
$data["credential[{$credential_id}][api_products]"] = $this->products[1]
->getName();
return $data;
}, function () {
$this
->assertSession()
->pageTextNotContains($this->products[0]
->label());
$this
->assertSession()
->pageTextContains($this->products[1]
->label());
});
}