You are here

public function FppLocaleTest::testLanguageNone in Fieldable Panels Panes (FPP) 7

Verify the language selector works with no language selected.

File

tests/fpp.locale.test, line 74
Confirm the language integration works correctly.

Class

FppLocaleTest
Confirm the language integration works correctly.

Code

public function testLanguageNone() {

  // 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);

  // Confirm the language selector is present on the page.
  $this
    ->assertFieldByName('language');
  $edit = array(
    'title' => $this->title,
    'language' => LANGUAGE_NONE,
  );
  $this
    ->drupalPost(NULL, $edit, t('Save'));
  $this
    ->drupalGet('admin/structure/fieldable-panels-panes/' . $this->bundle);
  $this
    ->assertResponse(200);
  $this
    ->assertText($this->title);

  // The entity created should have fpid 1.
  $fpp = fieldable_panels_panes_load(1);
  $this
    ->assertEqual($this->title, $fpp->title);

  // Confirm that the FPP's language is still 'none'.
  $language = entity_language('fieldable_panels_pane', $fpp);
  $this
    ->assertEqual($language, LANGUAGE_NONE);
}