public function FppLocaleTest::testLanguageEnglish in Fieldable Panels Panes (FPP) 7
Verify the language selector works with a specific language.
File
- tests/
fpp.locale.test, line 108 - Confirm the language integration works correctly.
Class
- FppLocaleTest
- Confirm the language integration works correctly.
Code
public function testLanguageEnglish() {
// 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' => 'en',
);
$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, 'en');
}