filterAllowedAttribute() public méthode

Return true if the value is allowed (remove not allowed attributes).
public filterAllowedAttribute ( string $tag, string $attribute, string $value ) : boolean
$tag string Tag name
$attribute string Attribute name
$value string Attribute value
Résultat boolean
 public function testFilterAllowedAttribute()
 {
     $filter = new Attribute(new Url('http://google.com'));
     $this->assertTrue($filter->filterAllowedAttribute('abbr', 'title', 'test'));
     $this->assertFalse($filter->filterAllowedAttribute('script', 'type', 'text/javascript'));
     $this->assertEquals(array(), $filter->filter('script', array('type' => 'text/javascript')));
     $this->assertEquals(array(), $filter->filter('a', array('onclick' => 'javascript')));
     $this->assertEquals(array('href' => 'http://google.com/'), $filter->filter('a', array('href' => 'http://google.com')));
 }