function expectError($error = false, $message = '%s') { // Because we're testing a definition, it's vital that the cache // is turned off for tests that expect errors. $this->config->set('Cache.DefinitionImpl', null); parent::expectError($error); }
public function __construct() { parent::__construct(); if ($GLOBALS['HTMLPurifierTest']['PH5P']) { require_once 'HTMLPurifier/Lexer/PH5P.php'; } }
public function setUp() { parent::setup(); $this->factory = new HTMLPurifier_DefinitionCacheFactory(); $this->oldFactory = HTMLPurifier_DefinitionCacheFactory::instance(); HTMLPurifier_DefinitionCacheFactory::instance($this->factory); }
public function __construct() { parent::__construct(); if ($GLOBALS['HTMLPurifierTest']['PEAR'] && version_compare(PHP_VERSION, '5.3', '<')) { require_once 'HTMLPurifier/Lexer/PEARSax3.php'; $this->_has_pear = true; } if ($GLOBALS['HTMLPurifierTest']['PH5P']) { require_once 'HTMLPurifier/Lexer/PH5P.php'; } }
public function __construct() { parent::__construct(); // E_STRICT = 2048, int used for PHP4 compat: this check disables // PEAR if PHP 5 strict mode is on, since the class is not strict safe if ($GLOBALS['HTMLPurifierTest']['PEAR'] && (error_reporting() & 2048) != 2048) { require_once 'HTMLPurifier/Lexer/PEARSax3.php'; $this->_has_pear = true; } if ($GLOBALS['HTMLPurifierTest']['PH5P']) { require_once 'HTMLPurifier/Lexer/PH5P.php'; } }
public function setup() { generate_mock_once('HTMLPurifier_Language'); generate_mock_once('HTMLPurifier_Generator'); parent::setup(); $this->language = new HTMLPurifier_LanguageMock(); $this->language->setReturnValue('getErrorName', 'Error', array(E_ERROR)); $this->language->setReturnValue('getErrorName', 'Warning', array(E_WARNING)); $this->language->setReturnValue('getErrorName', 'Notice', array(E_NOTICE)); // this might prove to be troublesome if we need to set config $this->generator = new HTMLPurifier_Generator($this->config, $this->context); $this->line = false; $this->context->register('Locale', $this->language); $this->context->register('CurrentLine', $this->line); $this->context->register('Generator', $this->generator); $this->collector = new HTMLPurifier_ErrorCollector($this->context); }
public function setUp() { parent::setUp(); $this->config->set('Output.Newline', "\n"); }
public function setUp() { $this->_entity_lookup = HTMLPurifier_EntityLookup::instance(); parent::setUp(); }
public function __construct($path) { $this->path = $path; parent::__construct($path); }
public function __construct() { $this->lexer = new HTMLPurifier_Lexer_DirectLex(); parent::__construct(); }
public function setUp() { $this->factory = HTMLPurifier_LanguageFactory::instance(); parent::setUp(); }