Skip to content

Commit

Permalink
New method
Browse files Browse the repository at this point in the history
  • Loading branch information
egulias committed Aug 24, 2014
1 parent a9ca0ea commit aa522fc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Tag/Tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ public function getName()
return $this->name;
}

public function getAttributes()
{
return $this->attributes;
}

public function hasAttribute($attrName)
{
return isset($this->attributes[$attrName]);
Expand Down
7 changes: 7 additions & 0 deletions Tests/Tag/TagTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,11 @@ public function testGetTagArgumentNotExistsThrowsException()

$tag->get('not-exists');
}

public function testGetAllArgumentsAsNameValue()
{
$tag = new Tag('aTag', array('attr1' => 'value', 'attr2' => 'value2'));

$this->assertEquals(array('attr1' => 'value', 'attr2' => 'value2'), $tag->getAttributes());
}
}

0 comments on commit aa522fc

Please sign in to comment.