diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-10-21 19:31:39 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-10-21 19:31:39 +0000 |
commit | 3cbd47d1458b9914d0ede84fd31d4ecc0c8e684b (patch) | |
tree | 5818038bc57b05fdcfa8b23fbf43e69f148f5f8b /modules/simpletest/tests | |
parent | 2a0e32644822d34416f4633b4c6fc8674870e6d8 (diff) | |
download | brdo-3cbd47d1458b9914d0ede84fd31d4ecc0c8e684b.tar.gz brdo-3cbd47d1458b9914d0ede84fd31d4ecc0c8e684b.tar.bz2 |
- Patch #647228 by sun, katbailey, Rob Loach: links are needlessly unable to fully participate in D7 AJAX framework features.
Diffstat (limited to 'modules/simpletest/tests')
-rw-r--r-- | modules/simpletest/tests/ajax.test | 8 | ||||
-rw-r--r-- | modules/simpletest/tests/ajax_test.module | 21 |
2 files changed, 29 insertions, 0 deletions
diff --git a/modules/simpletest/tests/ajax.test b/modules/simpletest/tests/ajax.test index 961188bc5..2788d4f90 100644 --- a/modules/simpletest/tests/ajax.test +++ b/modules/simpletest/tests/ajax.test @@ -59,6 +59,8 @@ class AJAXTestCase extends DrupalWebTestCase { * Tests primary AJAX framework functions. */ class AJAXFrameworkTestCase extends AJAXTestCase { + protected $profile = 'testing'; + public static function getInfo() { return array( 'name' => 'AJAX framework', @@ -84,6 +86,12 @@ class AJAXFrameworkTestCase extends AJAXTestCase { 'settings' => array('basePath' => base_path(), 'ajax' => 'test'), ); $this->assertCommand($commands, $expected, t('ajax_render() loads settings added with drupal_add_js().')); + + // Verify that AJAX settings are loaded for #type 'link'. + $this->drupalGet('ajax-test/link'); + $settings = $this->drupalGetSettings(); + $this->assertEqual($settings['ajax']['ajax-link']['url'], url('filter/tips')); + $this->assertEqual($settings['ajax']['ajax-link']['wrapper'], 'block-system-main'); } /** diff --git a/modules/simpletest/tests/ajax_test.module b/modules/simpletest/tests/ajax_test.module index cc8e6e8fe..70f87f512 100644 --- a/modules/simpletest/tests/ajax_test.module +++ b/modules/simpletest/tests/ajax_test.module @@ -24,6 +24,11 @@ function ajax_test_menu() { 'access callback' => TRUE, 'type' => MENU_CALLBACK, ); + $items['ajax-test/link'] = array( + 'title' => 'AJAX Link', + 'page callback' => 'ajax_test_link', + 'access callback' => TRUE, + ); return $items; } @@ -49,3 +54,19 @@ function ajax_test_error() { } return array('#type' => 'ajax', '#error' => $message); } + +/** + * Menu callback; Renders a #type link with #ajax. + */ +function ajax_test_link() { + $build['link'] = array( + '#type' => 'link', + '#title' => 'Show help', + '#href' => 'filter/tips', + '#ajax' => array( + 'wrapper' => 'block-system-main', + ), + ); + return $build; +} + |