You are here

public function EntityLegalMethodsTestCase::testSignupFormLinkMethod in Entity Legal 7.2

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

User signup form with link method test.

File

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

Class

EntityLegalMethodsTestCase
Simpletest class for acceptance methods.

Code

public function testSignupFormLinkMethod() {
  $document = $this
    ->createDocument(TRUE, TRUE, array(
    'new_users' => array(
      'require_method' => 'form_link',
    ),
  ));
  $this
    ->createDocumentVersion($document, TRUE);
  $this
    ->drupalGet('user/register');
  $this
    ->assertFieldByName('legal_' . $document
    ->identifier(), NULL, 'Agree checkbox found');
  $document_uri = entity_uri(ENTITY_LEGAL_DOCUMENT_ENTITY_NAME, $document);
  $document_path = $document_uri['path'];
  $this
    ->assertLinkByHref(url($document_path), 0, 'Link to document found');

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