You are here

public function Anonymouspublishingtest::testAnonymouspublishing in Anonymous Publishing 7

The main test function.

File

tests/anonymous_publishing.test, line 317

Class

Anonymouspublishingtest
Tests for the Anonymous Publishing modules.

Code

public function testAnonymouspublishing() {
  user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array(
    'access content',
    'create blog content',
    'access comments',
    'post comments',
    'skip comment approval',
  ));

  // A.
  $this
    ->checkPermission('article', 'Access denied');
  $this
    ->checkPermission('blog', 'Verification e-mail address:');
  $this
    ->createAnonContentNoEmail('blog', 'Verification e-mail address: field is required.');
  $this
    ->createAnonContentWrongEmail('blog', 'Please type in a valid e-mail address.');
  $this
    ->createAnonRequireAlias('blog', 'Please enter a byline');
  $this
    ->createWithAlias('blog', 'Please enter a byline', 5);
  $this
    ->createWithAlias('blog', 'has been created', 6);
  $this
    ->apTestingActivation('', 'No activation key present');
  $this
    ->apTestingActivation('1234', 'Invalid activation key');

  // B.
  $this
    ->createSaPeBoth('blog');

  // C.
  $this
    ->createSaNpBoth('blog');

  // D.
  $this
    ->createUnPeBoth('blog');

  // E.
  $this
    ->createByPeBoth('blog');
}