You are here

public function AttributeTest::createProductAdjustment in Ubercart 8.4

Creates a product adjustment SKU.

Parameters

array $data: Adjustment data for this product.

Return value

object Adjustment data as an object.

3 calls to AttributeTest::createProductAdjustment()
AttributeTest::testAttributeApi in uc_attribute/tests/src/Functional/AttributeTest.php
Tests the basic attribute API.
AttributeTest::testAttributeUiProductAdjustments in uc_attribute/tests/src/Functional/AttributeTest.php
Tests the "product adjustments" page.
AttributeTest::testProductAttribute in uc_attribute/tests/src/Functional/AttributeTest.php
Tests attributes applied to a product.

File

uc_attribute/tests/src/Functional/AttributeTest.php, line 917

Class

AttributeTest
Tests the product attribute API.

Namespace

Drupal\Tests\uc_attribute\Functional

Code

public function createProductAdjustment(array $data) {
  $adjustment = $data + [
    'model' => $this
      ->randomMachineName(8),
  ];
  \Drupal::database()
    ->insert('uc_product_adjustments')
    ->fields($adjustment)
    ->execute();
  return (object) $adjustment;
}