You are here

function BpcDisplayTestCase::assertNodeFormPopulated in Commerce Bulk Product Creation 7.2

Asserts that the node form is pre-populated with the correct values.

Parameters

array $product_ids: An array of product IDs that should be selected in the form.

1 call to BpcDisplayTestCase::assertNodeFormPopulated()
BpcDisplayTestCase::testWizardNodeCreation in modules/bpc_display/bpc_display.test
Tests wizard-style display node creation.

File

modules/bpc_display/bpc_display.test, line 275
Tests for Commerce BPC display node creation

Class

BpcDisplayTestCase
@file Tests for Commerce BPC display node creation

Code

function assertNodeFormPopulated($product_ids) {
  $this
    ->assertFieldByName('title', 'Title: ' . $this->params['title_fragment'], 'Title field is pre-populated with token-replaced settings value.');
  foreach ($product_ids as $id) {
    $this
      ->assertOptionSelected('edit-field-product-und', $id);
  }
  if (!empty($product_ids)) {
    $id = 1;
    while (!in_array($id, $product_ids)) {
      $this
        ->assertNoOptionSelected('edit-field-product-und', $id);
      $id++;
    }
  }
}