diff options
author | Nuno Lopes <nlopess@php.net> | 2007-01-23 19:26:24 +0000 |
---|---|---|
committer | Nuno Lopes <nlopess@php.net> | 2007-01-23 19:26:24 +0000 |
commit | a2b7b84685d8469e394d57e8fb42c6d3a620207f (patch) | |
tree | 39a4067a845d7d1784b8adf1c73e1b0b3a1ddc1e /ext/tidy | |
parent | 8e8b369bc2040dc9bbfc9b9b49cf57da077e4ac1 (diff) | |
download | php-git-a2b7b84685d8469e394d57e8fb42c6d3a620207f.tar.gz |
add test
Diffstat (limited to 'ext/tidy')
-rw-r--r-- | ext/tidy/tests/027.phpt | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/ext/tidy/tests/027.phpt b/ext/tidy/tests/027.phpt new file mode 100644 index 0000000000..8d9f66eaf7 --- /dev/null +++ b/ext/tidy/tests/027.phpt @@ -0,0 +1,59 @@ +--TEST-- +Bug: tidy segfaults with markup=false +--SKIPIF-- +<?php if (!extension_loaded('tidy')) die('skip'); ?> +--FILE-- +<?php + +// bug report from http://sf.net/tracker/?func=detail&atid=390963&aid=1641868&group_id=27659 + +abstract class BaseClass { + private static $tidyconfig; + + public function BaseClass() { + $this->tidyconfig = array( + 'indent' => false, + 'clean' => true, + 'merge-divs' => false, + 'quote-marks' => true, + 'drop-empty-paras' => false, + 'markup' => false, + 'output-xhtml' => true, + 'wrap' => 0); + + } + + abstract public function run(); + + public function getURL($url) { + $data = "awerawer"; // in my code, $data is downloaded from a site + + $tidy = new tidy; + $tidy->parseString($data, $this->tidyconfig, 'utf8'); + $tidy->cleanRepair(); + + return $tidy; + } + +} + +class ChildClass extends BaseClass { + public function ChildClass() { + parent::__construct(); + } + + public function run() { + $result = $this->getURL('awer'); + if ($result === null) { + echo "\tError:\n"; + } + var_dump((string)$result); + } +} + +$instance = new ChildClass(); +$instance->run(); + +?> +--EXPECT-- +string(0) "" |