You are here

public function FppEntityFormTest::testNewEntity in Fieldable Panels Panes (FPP) 7

Confirm that the basic form fields show on the 'add' form.

File

tests/fpp.entity_form.test, line 28
Tests for the Fieldable Panels Panes module to ensure the basic form works.

Class

FppEntityFormTest
Tests for the Fieldable Panels Panes module to ensure the basic form works.

Code

public function testNewEntity() {

  // Create a user with the admin permission.
  $this->adminUser = $this
    ->createAdminUser();
  $this
    ->drupalLogin($this->adminUser);

  // Load the fpp-add form.
  $this
    ->drupalGet('admin/structure/fieldable-panels-panes/' . $this->bundle . '/add');
  $this
    ->assertResponse(200);

  // Check all of the default fields.
  // The basic title field.
  $this
    ->assertFieldByName('title');

  // The "make title a link" option's fields.
  $this
    ->assertFieldByName('link');
  $this
    ->assertFieldByName('path');

  // The admin title & description fields.
  $this
    ->assertFieldByName('admin_title');
  $this
    ->assertFieldByName('admin_description');

  // By default all FPPs will be reusable.
  $this
    ->assertFieldByName('reusable');

  // Because FPPs can be reusable they can be grouped in categories in the
  // Panels admin UI.
  $this
    ->assertFieldByName('category');

  // The language selector is not present because the Locale module is not
  // enabled by default.
  $this
    ->assertNoFieldByName('language');

  // The revision selector is disabled by default because you only don't
  // create a new revision on a new object.
  $this
    ->assertNoFieldByName('revision');
  $this
    ->assertNoFieldByName('log');
}