Permalink
Browse files

Class attribute in a tag must be an array, not a string.

Fixes #50
  • Loading branch information...
1 parent 3c7ca9d commit 23de03b8d5a2c2dc2ceb0ace07ad554d2a382558 Bèr Kessels committed Mar 27, 2013
Showing with 3 additions and 3 deletions.
  1. +2 −2 TagadelicTag.php
  2. +1 −1 tests/TagadelicTagToStringTest.php
View
@@ -36,8 +36,8 @@ public function __ToString() {
$attributes = $options = array();
- if (!empty($this->description)) $attributes["title"] = $this->description;
- if ($this->weight > 0) $attributes["class"] = "level{$this->weight}";
+ if (!empty($this->description)) $attributes["title"] = $this->description;
+ if ($this->weight > 0) $attributes["class"][] = "level{$this->weight}";
if (!empty($attributes)) $options["attributes"] = $attributes;
@@ -83,7 +83,7 @@ public function test__ToStringHasNoTitle() {
*/
public function test__ToStringHasWeight() {
$this->object->set_weight(3);
- $expected_attrs = array("class" => "level3");
+ $expected_attrs = array("class" => array("level3"));
$this->drupal->expects($this->any())
->method('l')

0 comments on commit 23de03b

Please sign in to comment.