protected function CatalogTestTrait::createCatalogTerm in Ubercart 8.4
Returns a new term with random properties in the catalog vocabulary.
Parameters
array $values: Array of values to override the default term values.
9 calls to CatalogTestTrait::createCatalogTerm()
- CatalogBlockTest::testCatalogBlock in uc_catalog/
tests/ src/ Functional/ CatalogBlockTest.php - Tests catalog block basic functionality.
- CatalogBlockTest::testExpandCategories in uc_catalog/
tests/ src/ Functional/ CatalogBlockTest.php - Tests the expand catalog categories functionality.
- CatalogBlockTest::testProductCountDisplay in uc_catalog/
tests/ src/ Functional/ CatalogBlockTest.php - Tests display of product counts in catalog block.
- CatalogBreadcrumbTest::testCatalogBreadcrumb in uc_catalog/
tests/ src/ Functional/ CatalogBreadcrumbTest.php - Tests the catalog view breadcrumb.
- CatalogBreadcrumbTest::testProductBreadcrumb in uc_catalog/
tests/ src/ Functional/ CatalogBreadcrumbTest.php - Tests the product node breadcrumb.
File
- uc_catalog/
tests/ src/ Traits/ CatalogTestTrait.php, line 23
Class
- CatalogTestTrait
- Utility functions to provide catalog taxonomy terms for test purposes.
Namespace
Drupal\Tests\uc_catalog\TraitsCode
protected function createCatalogTerm(array $values = []) {
$term = Term::create($values + [
'name' => $this
->randomMachineName(),
'description' => [
'value' => $this
->randomMachineName(),
'format' => 'plain_text',
],
'vid' => 'catalog',
'langcode' => Language::LANGCODE_NOT_SPECIFIED,
]);
$term
->save();
return $term;
}