You are here

public function EntityLegalMethodsTestCase::testProfileFormInlineMethod in Entity Legal 7.2

Same name and namespace in other branches
  1. 7 tests/entity_legal.methods.test \EntityLegalMethodsTestCase::testProfileFormInlineMethod()

User signup form with inline method test.

File

tests/entity_legal.methods.test, line 136
Test for defined methods in Entity Legal module.

Class

EntityLegalMethodsTestCase
Simpletest class for acceptance methods.

Code

public function testProfileFormInlineMethod() {
  $document = $this
    ->createDocument(TRUE, TRUE, array(
    'new_users' => array(
      'require_method' => 'form_inline',
    ),
  ));
  $this
    ->createDocumentVersion($document, TRUE);
  $this
    ->drupalGet('user/register');
  $this
    ->assertFieldByName('legal_' . $document
    ->identifier(), NULL, 'Agree checkbox found');
  $this
    ->assertRaw('<div class="entity entity-entity-legal-document-version entity-legal-document-version-' . $document
    ->identifier(), 'Document markup found on register page');

  // Ensure the field extra field is available for re-ordering.
  $this
    ->drupalLogin($this->adminUser);
  $this
    ->drupalGet('admin/config/people/accounts/fields');
  $this
    ->assertText('legal_' . $document
    ->identifier());
}