diff --git a/cas_attributes.test b/cas_attributes.test
index fd70bd4..26575e9 100644
--- a/cas_attributes.test
+++ b/cas_attributes.test
@@ -18,9 +18,34 @@ class CasAttributesTestHelper extends CasTestHelper {
     if (isset($modules[0]) && is_array($modules[0])) {
       $modules = $modules[0];
     }
-    $modules = array_merge(array('cas_attributes'), $modules);
+    $modules = array_merge(array('cas_attributes', 'cas_attributes_test'), $modules);
     parent::setUp($modules);
   }
+
+  /**
+   * Assert the value of the token.
+   *
+   * @param $cas_token
+   *   A token to evaluate for the current CAS user, e.g., 'attributes:memberOf'.
+   * @param $value
+   *   An array of expected values.
+   * @param $message
+   *   The message to display along with the assertion.
+   *
+   * @return
+   *  TRUE if the assertion succeeded, FALSE otherwise.
+   */
+  function assertArrayToken($cas_token, $value, $message = '') {
+    $options = array(
+      'query' => array(
+        'token' => $cas_token,
+        'name' => $this->loggedInUser->cas_name,
+      ),
+    );
+    $path = 'cas_attributes_test/array_token';
+    $out = $this->drupalGet($path, $options);
+    return $this->assertEqual($out, print_r($value, TRUE), $message, 'Token');
+  }
 }
 
 /**
@@ -58,6 +83,9 @@ class CasAttributesTokenTestCase extends CasAttributesTestHelper {
     $keys = array_merge(array('attraStyle'), array_keys($attributes));
     $keys = array_map('drupal_strtolower', $keys);
     $this->assertToken('[cas:attribute:?]', t('Available attributes: %keys', array('%keys' => implode(', ', $keys))));
+
+    $this->assertArrayToken('attribute:givenName', array($attributes['givenName']));
+    $this->assertArrayToken('attribute:memberOf', $attributes['memberOf']);
   }
 }
 
diff --git a/cas_attributes.tokens.inc b/cas_attributes.tokens.inc
index 5bb085c..5e69b41 100644
--- a/cas_attributes.tokens.inc
+++ b/cas_attributes.tokens.inc
@@ -23,6 +23,7 @@ function cas_attributes_token_info_alter(&$data) {
  */
 function cas_attributes_tokens($type, $tokens, array $data = array(), array $options = array()) {
   $sanitize = !empty($options['sanitize']);
+  $raw_array = !empty($options['raw_array']);
   $replacements = array();
 
   if ($type == 'cas' && !empty($data['cas'])) {
@@ -35,10 +36,25 @@ function cas_attributes_tokens($type, $tokens, array $data = array(), array $opt
         $name = drupal_strtolower($name);
         if (isset($attribute[$name])) {
           $value = $attribute[$name];
-          if (is_array($value)) {
-            $value = $value[0];
+
+          if ($raw_array) {
+            // We provide a way to get an actual array of values. This is a
+            // blatant misuse of the token system, but useful for the CAS
+            // attribute roles implementation.
+            if (!is_array($value)) {
+              $value = array($value);
+            }
+            $replacements[$original] = $sanitize ? array_map('check_plain', $value) : $value;
+          }
+          else {
+            // Otherwise we return the text of only the first attribute found.
+            // In the future we may want to allow getting additional values
+            // using the Token module's 'array' token type.
+            if (is_array($value)) {
+              $value = $value[0];
+            }
+            $replacements[$original] = $sanitize ? check_plain($value) : $value;
           }
-          $replacements[$original] = $sanitize ? check_plain($value) : $value;
         }
         elseif ($name == '?') {
           $keys = array_keys($attribute);
diff --git a/tests/cas_attributes_test.info b/tests/cas_attributes_test.info
index 441f68d..dfb4165 100644
--- a/tests/cas_attributes_test.info
+++ b/tests/cas_attributes_test.info
@@ -4,4 +4,8 @@ package = Testing
 core = 7.x
 hidden = TRUE
 
+; Token is a (potential) optional dependency for CAS Attributes. Since there
+; is no way to specify optional or test dependencies yet, we add a hard
+; dependency here so that qa.drupal.org makes token available.
+; @see http://drupal.org/node/698932
 dependencies[] = token
diff --git a/tests/cas_attributes_test.module b/tests/cas_attributes_test.module
index 41ec18b..7e2e25a 100644
--- a/tests/cas_attributes_test.module
+++ b/tests/cas_attributes_test.module
@@ -2,9 +2,31 @@
 
 /**
  * @file
- * Dummy module to force qa.drupal.org to download the token module.
- *
- * @todo Remove when test_dependencies[] can be specified in the
- *   cas_attributes.info file.
- * @see http://drupal.org/node/698932
+ * Helper module which evaluates CAS Attributes array tokens.
  */
+
+/**
+ * Implements hook_menu().
+ */
+function cas_attributes_test_menu() {
+  $items = array();
+  $items['cas_attributes_test/array_token'] = array(
+    'page callback' => 'cas_attributes_test_array_token_evaluate',
+    'title' => 'CAS Attributes Array Token Test',
+    'access callback' => TRUE,
+    'type' => MENU_CALLBACK,
+  );
+  return $items;
+}
+
+function cas_attributes_test_array_token_evaluate() {
+  $tokens = array($_GET['token'] => '[original]');
+  $options = array(
+    'raw_array' => TRUE,
+    'sanitize' => FALSE,
+  );
+  $data = array('cas' => $_GET['name']);
+  $replacements = token_generate('cas', $tokens, $data, $options);
+  print_r($replacements['[original]']);
+  exit(0);
+}
