 src/Tests/ExtlinkAdminTest.php | 28 +++++++++++++++++
 src/Tests/ExtlinkTest.php      | 14 +++++++++
 src/Tests/ExtlinkTestBase.php  | 69 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 111 insertions(+)

diff --git a/src/Tests/ExtlinkAdminTest.php b/src/Tests/ExtlinkAdminTest.php
new file mode 100644
index 0000000..855ce1b
--- /dev/null
+++ b/src/Tests/ExtlinkAdminTest.php
@@ -0,0 +1,28 @@
+<?php
+
+namespace Drupal\captcha\Tests;
+
+use Drupal\simpletest\WebTestBase;
+
+/**
+ * Testing of the External Links administration interface and functionality.
+ *
+ * @group External Links
+ *
+ */
+class ExtlinkAdminTest extends ExtlinkTestBase {
+   /**
+   * Test access to the admin pages.
+   */
+  function testAdminAccess() {
+    $this->drupalLogin($this->normal_user);
+    $this->drupalGet(self::EXTLINK_ADMIN_PATH);
+    file_put_contents('tmp.simpletest.html', $this->drupalGetContent());
+    $this->assertText(t('Access denied'), 'Normal users should not be able to access the External Links admin pages', 'External Links');
+
+    $this->drupalLogin($this->admin_user);
+    $this->drupalGet(self::EXTLINK_ADMIN_PATH);
+    file_put_contents('tmp.simpletest.html', $this->drupalGetContent());
+    $this->assertNoText(t('Access denied'), 'Admin users should be able to access the External Links admin pages', 'External Links');
+  }
+}
\ No newline at end of file
diff --git a/src/Tests/ExtlinkTest.php b/src/Tests/ExtlinkTest.php
new file mode 100644
index 0000000..7536a10
--- /dev/null
+++ b/src/Tests/ExtlinkTest.php
@@ -0,0 +1,14 @@
+<?php
+
+namespace Drupal\captcha\Tests;
+
+use Drupal\simpletest\WebTestBase;
+
+/**
+ * Testing the basic functionality of External Links
+ *
+ * @group External Links
+ *
+ */
+class ExtlinkTest extends ExtlinkTestBase {
+}
\ No newline at end of file
diff --git a/src/Tests/ExtlinkTestBase.php b/src/Tests/ExtlinkTestBase.php
new file mode 100644
index 0000000..7402137
--- /dev/null
+++ b/src/Tests/ExtlinkTestBase.php
@@ -0,0 +1,69 @@
+<?php
+
+namespace Drupal\captcha\Tests;
+
+use Drupal\simpletest\WebTestBase;
+
+/**
+ * Base class for External Link tests.
+ *
+ * Provides common setup stuff and various helper functions
+ */
+abstract class ExtlinkTestBase extends WebTestBase {
+	
+  public static $modules = array('extlink');
+  
+  /**
+   * User with various administrative permissions.
+   * @var Drupal user
+   */
+  protected $admin_user;
+
+  /**
+   * Normal visitor with limited permissions
+   * @var Drupal user;
+   */
+  protected $normal_user;
+  
+  /**
+   * Drupal path of the (general) External Links admin page
+   */
+  const EXTLINK_ADMIN_PATH = 'admin/config/user-interface/extlink';
+  
+  function setUp() {
+    // Enable any module that you will need in your tests.
+    parent::setUp();
+
+    // Create a normal user.
+    $permissions = array(
+      'access comments', 'post comments', 'skip comment approval',
+      'access content', 'create page content', 'edit own page content',
+    );
+    $this->normal_user = $this->drupalCreateUser($permissions);
+
+    // Create an admin user.
+    $permissions[] = 'administer site configuration';
+    $permissions[] = 'administer permissions';
+    $permissions[] = 'administer content types';
+    $this->admin_user = $this->drupalCreateUser($permissions);
+  }
+  
+  protected function getNodeFormValues() {
+    $edit = array(
+      'title' => 'node_title ' . $this->randomName(32),
+      'body[' . LANGUAGE_NONE . '][0][value]' => 'node_body ' . $this->randomName(256) . ' <a href="http://google.com">Google!</a>',
+    );
+    return $edit;
+  }
+  
+  /**
+   * Test if External Link is present
+   */
+  protected function assertExternalLinkPresence() {
+    $elements = $this->xpath('//span[@class="ext"]');
+    if (count($elements) > 0)
+       $this->pass('There should be an External Link on the form.', 'External Links');
+    else
+       $this->fail('There should be an External Link on the form.', 'External Links');
+  }
+}
\ No newline at end of file
