public function EntityBackgroundEnableCheckboxTest::testEntityBackgroundTestCheckbox in Entity background 7
Test enabling eb via the checkbox.
File
- tests/
entity_background.test, line 62 - Test classes for Entity backgrounds.
Class
- EntityBackgroundEnableCheckboxTest
- Class EntityBackgroundEnableCheckboxTest
Code
public function testEntityBackgroundTestCheckbox() {
// Shouldn't see the checkbox on the create paragraph type.
$this
->drupalGet('admin/structure/paragraphs/add');
$this
->assertText(t('Please create paragraph bundle before configuring entity background.'));
// Get to paragraphs admin page.
$this
->drupalGet('admin/structure/paragraphs/eb-content-test/edit');
$this
->assertText(t('Enable entity background for EB Content (test)'));
// Enable BD.
$edit = array();
$edit['eb_enabled'] = TRUE;
$this
->drupalPost('admin/structure/paragraphs/eb-content-test/edit', $edit, t('Save Paragraph bundle'));
$this
->assertText(t('The paragraph bundle EB Content (test) has been updated.'));
$this
->drupalGet('admin/structure/paragraphs/eb-content-test/fields');
$this
->assertText('eb_background');
}