You are here

public function FreelinkingPrepopulateTest::testFreelinkingPrepopulate in Freelinking 6.3

Tests plugin features

File

modules/freelinking_prepopulate/freelinking_prepopulate.test, line 55
Unit tests for the freelinking prepopulate module

Class

FreelinkingPrepopulateTest
@file Unit tests for the freelinking prepopulate module

Code

public function testFreelinkingPrepopulate() {

  // Create node that will contain a sample of each plugin
  $edit = array();
  $edit['title'] = t('Testing freelinking prepopulate plugin');
  $edit['body'] = '<ul>' . '  <li>[[createnode:test page]]</li>' . '</ul>';
  $this
    ->drupalPost('node/add/page', $edit, t('Save'));
  $this
    ->assertText(t('Page @title has been created.', array(
    '@title' => $edit['title'],
  )));

  // Verify link generation
  $this
    ->assertRaw('/node/add/page?edit%5Btitle%5D=test%20page', t('Createnode freelink was generated successfully.'));
}