Development

Changeset 18915

You must first sign up to be able to contribute.

Changeset 18915

Show
Ignore:
Timestamp:
06/04/09 14:37:33 (4 years ago)
Author:
heristop
Message:

[sfXssSafePlugin] [UT] [1.2] added html purifier autoloading test

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfXssSafePlugin/branches/1.2/test/unit/XssSafeTest.php

    r18693 r18915  
    11<?php 
    2   
    3 // initializes testing framework 
    4 $app = 'frontend'; 
    5 $sf_root = dirname(__FILE__).'/../../../..'; 
    6 require_once($sf_root.'/lib/symfony/vendor/lime/lime.php'); 
    7 include($sf_root.'/test/bootstrap/functional.php'); 
     2 
     3// initializes testing framework [sf 1.2] 
     4require_once(dirname(__FILE__).'/../../../../test/bootstrap/unit.php'); 
    85 
    96// add filters to the default configuration 
     
    6360              'src*' => 'URI', 
    6461              'flashvars' => 'Text', 
    65               'allowscriptaccess' => 'Enum#never', 
     62              /*'allowscriptaccess' => 'Enum#never',*/ 
    6663              'enablejsurls' => 'Enum#false', 
    6764              'enablehref' => 'Enum#false', 
     65              'allowfullscreen' => 'Text', 
    6866              'bgcolor' => 'Text', 
    6967              'align' => 'Text', 
     
    382380    'input'   => '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="video_small" align="middle" height="370" width="417"> 
    383381<param name="allowScriptAccess" value="sameDomain"> 
    384 <param name="allowFullScreen" value="false"> 
     382<param name="allowFullScreen" value="true"> 
    385383<param name="FlashVars" value="video=http://www.toppeo.com/flv/demospectacle4473EE7B_8003221.flv"> 
    386384<param name="movie" value="/player/player.swf"><param name="quality" value="high"> 
    387385<param name="bgcolor" value="#000000"> 
    388 <embed src="/player/player.swf" flashvars="video=http://www.toppeo.com/flv/demospectacle4473EE7B_8003221.flv" quality="high" bgcolor="#000000" name="video_small" allowscriptaccess="sameDomain" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" align="middle" height="370" width="417"> 
     386<embed src="/player/player.swf" flashvars="video=http://www.toppeo.com/flv/demospectacle4473EE7B_8003221.flv" quality="high" bgcolor="#000000" name="video_small" allowscriptaccess="sameDomain" allowfullscreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" align="middle" height="370" width="417"> 
    389387</object>', 
    390     'output'  => '<embed src="/player/player.swf" flashvars="video=http://www.toppeo.com/flv/demospectacle4473EE7B_8003221.flv" quality="high" bgcolor="#000000" name="video_small" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" align="middle" height="370" width="417" enablejsurls="false" enablehref="false" allowfullscreen="true" />', 
     388    'output'  => '<embed src="/player/player.swf" flashvars="video=http://www.toppeo.com/flv/demospectacle4473EE7B_8003221.flv" quality="high" bgcolor="#000000" name="video_small" allowfullscreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" align="middle" height="370" width="417" allowscriptaccess="never" enablejsurls="false" enablehref="false" />', 
    391389    'filter'  => true 
    392390  ) 
     
    398396$t->diag('XssSafe Helper'); 
    399397$t->include_ok(sfConfig::get('sf_plugins_dir').'/sfXssSafePlugin/lib/helper/XssSafeHelper.php', 'XssSafe Helper include'); 
    400 $t->include_ok(sfConfig::get('sf_plugins_dir').'/sfXssSafePlugin/lib/vendor/htmlpurifier/HTMLPurifier.auto.php', 'HTML Purifier include'); 
     398$t->is(class_exists('HTMLPurifier_Config'), true, 'HTML Purifier autoload'); 
    401399 
    402400// XSS Attacks Smoketest 
  • plugins/sfXssSafePlugin/trunk/test/unit/XssSafeTest.php

    r18911 r18915  
    11<?php 
    22 
    3 /** 
    4  * Unit tests for Sf 1.0 
    5  */ 
    6  
    7 // initializes testing framework 
    8 $sf_root = dirname(__FILE__).'/../../../..'; 
    9 require_once($sf_root.'/lib/symfony/vendor/lime/lime.php'); 
    10 include($sf_root.'/test/bootstrap/functional.php'); 
     3// initializes testing framework [sf 1.2] 
     4require_once(dirname(__FILE__).'/../../../../test/bootstrap/unit.php'); 
    115 
    126// add filters to the default configuration 
     
    402396$t->diag('XssSafe Helper'); 
    403397$t->include_ok(sfConfig::get('sf_plugins_dir').'/sfXssSafePlugin/lib/helper/XssSafeHelper.php', 'XssSafe Helper include'); 
    404 $t->include_ok(sfConfig::get('sf_plugins_dir').'/sfXssSafePlugin/lib/vendor/htmlpurifier/HTMLPurifier.auto.php', 'HTML Purifier include'); 
     398$t->is(class_exists('HTMLPurifier_Config'), true, 'HTML Purifier autoload'); 
    405399 
    406400// XSS Attacks Smoketest