Community Documentation

Accessible Content for Developers

Last updated February 16, 2010. Created by kevee on February 16, 2010.
Log in to edit this page.

Developers who want to write custom accessibility tests can do so by first implementing a simple hook to install the test, and then using the QUAIL library standards to extend a base testing framework class.

Installing The Test

To install a test, implement the hook hook_accessible_content_install_tests using the following example:

function mymodule_accessible_content_install_tests() {
  return array(
    'mytestclass' => array(
      'title' => 'My Test',
      'body' => 'A more thorough description of my test',
      'severity' => QUAIL_TEST_SEVERE,
      'file' => drupal_get_path('module', 'mymodule') .'/mytest.inc',
    ),
  );
}

The function should return a keyed array where the key is the name of the class (to follow), and which contains the title, body, and severity level of the test. If the test will be contained in another file, then include the path to the file as well. Accessible Content will then create a node on any hook_menu_alter event.

Extending the base QUAIL test class

Your module should then use the instructions covered in the QUAIL site for extending the base QUAIL test classes to write a new test.

Page status

No known problems

Log in to edit this page

About this page

Drupal version
Drupal 6.x
Audience
Programmers
Drupal’s online documentation is © 2000-2013 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License. Comments on documentation pages are used to improve content and then deleted.
nobody click here