protected function ApigeeEdgeFunctionalTestTrait::createProduct in Apigee Edge 8
Creates a product.
Return value
\Drupal\apigee_edge\Entity\ApiProduct (SDK) API product object.
14 calls to ApigeeEdgeFunctionalTestTrait::createProduct()
- AppSettingsFormTest::setUp in tests/
src/ FunctionalJavascript/ AppSettingsFormTest.php - DeveloperAppApiKeysPermissionTest::setUp in tests/
src/ Functional/ DeveloperAppApiKeysPermissionTest.php - DeveloperAppUITest::setUp in tests/
src/ Functional/ DeveloperAppUITest.php - DeveloperAppUITest::setUp in tests/
src/ FunctionalJavascript/ DeveloperAppUITest.php - DeveloperAppUITest::testAppCrudMultipleProductsAdd in tests/
src/ Functional/ DeveloperAppUITest.php - Creates an app with no products and then adds multiple ones.
File
- tests/
src/ Traits/ ApigeeEdgeFunctionalTestTrait.php, line 136
Class
- ApigeeEdgeFunctionalTestTrait
- Provides common functionality for the Apigee Edge test classes.
Namespace
Drupal\Tests\apigee_edge\TraitsCode
protected function createProduct() : ApiProduct {
/** @var \Drupal\apigee_edge\Entity\ApiProduct $product */
$product = ApiProduct::create([
'name' => $this
->randomMachineName(),
'displayName' => $this
->getRandomGenerator()
->word(16),
'approvalType' => ApiProduct::APPROVAL_TYPE_AUTO,
]);
$product
->save();
return $product;
}