From: Patrick Allaert Date: Tue, 1 Sep 2009 13:41:18 +0000 (+0000) Subject: Merging last tests made in HEAD X-Git-Tag: php-5.2.11RC2~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3891e2a52eba82cd59c27685f956d08eb8c1c8ba;p=php Merging last tests made in HEAD --- diff --git a/ext/tidy/tests/030.phpt b/ext/tidy/tests/030.phpt new file mode 100644 index 0000000000..c351f9af15 --- /dev/null +++ b/ext/tidy/tests/030.phpt @@ -0,0 +1,29 @@ +--TEST-- +getConfig() method - basic test for getConfig() +--CREDITS-- +Christian Wenz +--SKIPIF-- + +--FILE-- +'; +$config = array( + 'indent' => true, // AutoBool + 'indent-attributes' => true, // Boolean + 'indent-spaces' => 3, // Integer + 'language' => 'de'); // String +$tidy = new tidy(); +$tidy->parseString($buffer, $config); +$c = $tidy->getConfig(); +var_dump($c['indent']); +var_dump($c['indent-attributes']); +var_dump($c['indent-spaces']); +var_dump($c['language']); +?> +--EXPECTF-- +int(1) +bool(true) +int(3) +%s(2) "de" diff --git a/ext/tidy/tests/031.phpt b/ext/tidy/tests/031.phpt new file mode 100644 index 0000000000..cf6aed9cce --- /dev/null +++ b/ext/tidy/tests/031.phpt @@ -0,0 +1,18 @@ +--TEST-- +tidy_config_count() function - basic test for tidy_config_count() +--CREDITS-- +Christian Wenz +--SKIPIF-- + +--FILE-- +'; +$config = array('doctype' => 'php'); + +$tidy = tidy_parse_string($buffer, $config); +var_dump(tidy_config_count($tidy)); +?> +--EXPECTF-- +int(%d) diff --git a/ext/tidy/tests/032.phpt b/ext/tidy/tests/032.phpt new file mode 100644 index 0000000000..23230b0650 --- /dev/null +++ b/ext/tidy/tests/032.phpt @@ -0,0 +1,17 @@ +--TEST-- +tidy_error_count() function - basic test for tidy_error_count() +--CREDITS-- +Christian Wenz +--SKIPIF-- + +--FILE-- +'; + +$tidy = tidy_parse_string($buffer); +var_dump(tidy_error_count($tidy)); +?> +--EXPECTF-- +int(%d) diff --git a/ext/tidy/tests/033.phpt b/ext/tidy/tests/033.phpt new file mode 100644 index 0000000000..2c4bb44d47 --- /dev/null +++ b/ext/tidy/tests/033.phpt @@ -0,0 +1,17 @@ +--TEST-- +tidy_warning_count() function - basic test for tidy_warning_count() +--CREDITS-- +Christian Wenz +--SKIPIF-- + +--FILE-- +'; + +$tidy = tidy_parse_string($buffer); +var_dump(tidy_warning_count($tidy)); +?> +--EXPECTF-- +int(%d) diff --git a/ext/tidy/tests/034.phpt b/ext/tidy/tests/034.phpt new file mode 100644 index 0000000000..9780315239 --- /dev/null +++ b/ext/tidy/tests/034.phpt @@ -0,0 +1,20 @@ +--TEST-- +tidy_access_count() function - basic test for tidy_access_count() +--CREDITS-- +Christian Wenz +--SKIPIF-- + +--FILE-- +'; +$config = array( + 'accessibility-check' => 1); + +$tidy = tidy_parse_string($buffer, $config); +$tidy->diagnose(); +var_dump(tidy_access_count($tidy)); +?> +--EXPECTF-- +int(%d) diff --git a/ext/tidy/tests/tidy_error1.phpt b/ext/tidy/tests/tidy_error1.phpt new file mode 100644 index 0000000000..a92446925f --- /dev/null +++ b/ext/tidy/tests/tidy_error1.phpt @@ -0,0 +1,19 @@ +--TEST-- +Notice triggered by invalid configuration options +--CREDITS-- +Christian Wenz +--SKIPIF-- + +--FILE-- +'; +$config = array('bogus' => 'willnotwork'); + +$tidy = new tidy(); +var_dump($tidy->parseString($buffer, $config)); +?> +--EXPECTF-- +Notice: tidy::parseString(): Unknown Tidy Configuration Option 'bogus' in %s on line %d +bool(true)