PHPIDS
Current file: /home/mario/workspace/php-ids.org/trunk/lib/IDS/vendors/htmlpurifier/HTMLPurifier/AttrDef/CSS/DenyElementDecorator.php
Legend: executed not executed dead code

  Coverage
  Classes Methods Lines
Total
100.00 %100.00%
100.00% 1 / 1
0.00 %0.00%
0.00% 0 / 2
25.00 %25.00%
25.00% 1 / 4
 
HTMLPurifier_AttrDef_CSS_DenyElementDecorator
100.00 %100.00%
100.00% 1 / 1
0.00 %0.00%
0.00% 0 / 2
25.00 %25.00%
25.00% 1 / 4
 public function __construct($def, $element)
0.00 %0.00%
0.00% 0 / 1
100.00 %100.00%
100.00% 0 / 0
 public function validate($string, $config, $context)
0.00 %0.00%
0.00% 0 / 1
0.00 %0.00%
0.00% 0 / 3


       1                 : <?php                                                                           
       2                 :                                                                                 
       3                 : /**                                                                             
       4                 :  * Decorator which enables CSS properties to be disabled for specific elements. 
       5                 :  */                                                                             
       6               1 : class HTMLPurifier_AttrDef_CSS_DenyElementDecorator extends HTMLPurifier_AttrDef
       7                 : {                                                                               
       8                 :     protected $def, $element;                                                   
       9                 :                                                                                 
      10                 :     /**                                                                         
      11                 :      * @param $def Definition to wrap                                           
      12                 :      * @param $element Element to deny                                          
      13                 :      */                                                                         
      14                 :     public function __construct($def, $element) {                               
      15                 :         $this->def = $def;                                                      
      16                 :         $this->element = $element;                                              
      17                 :     }                                                                           
      18                 :     /**                                                                         
      19                 :      * Checks if CurrentToken is set and equal to $this->element                
      20                 :      */                                                                         
      21                 :     public function validate($string, $config, $context) {                      
      22               0 :         $token = $context->get('CurrentToken', true);                           
      23               0 :         if ($token && $token->name == $this->element) return false;             
      24               0 :         return $this->def->validate($string, $config, $context);                
      25                 :     }                                                                           
      26                 : }                                                                               

Generated by PHPUnit 3.2.20 and Xdebug 2.0.3 at Sat Jun 7 16:34:07 CEST 2008.