You are here

public function CommerceProductReferenceAdminTest::testCommerceProductReferenceDisplayFields in Commerce Core 7

Test the display of fields pulled from the product.

File

modules/product_reference/tests/commerce_product_reference.test, line 260
Tests for adding and displaying product reference fields.

Class

CommerceProductReferenceAdminTest
Functional tests for the Product Reference module.

Code

public function testCommerceProductReferenceDisplayFields() {

  // Go to manage fields screen of the product display.
  $this
    ->drupalGet('admin/structure/types/manage/' . strtr($this->display_type->type, '_', '-') . '/display');

  // Load all the fields that are pulled with the product and check if they
  // are in the display screen.
  $extra_fields = field_info_extra_fields('node', $this->display_type->type, 'display');
  foreach ($extra_fields as $display) {
    $this
      ->assertText($display['label'], t('Field %field_label is present in the manage display screen', array(
      '%field_label' => $display['label'],
    )));
  }
}