]> granicus.if.org Git - php/commitdiff
Added: Tidy basic test for getConfig()
authorPatrick Allaert <patrickallaert@php.net>
Thu, 27 Aug 2009 08:50:07 +0000 (08:50 +0000)
committerPatrick Allaert <patrickallaert@php.net>
Thu, 27 Aug 2009 08:50:07 +0000 (08:50 +0000)
ext/tidy/tests/030.phpt [new file with mode: 0644]

diff --git a/ext/tidy/tests/030.phpt b/ext/tidy/tests/030.phpt
new file mode 100644 (file)
index 0000000..c351f9a
--- /dev/null
@@ -0,0 +1,29 @@
+--TEST--
+getConfig() method - basic test for getConfig()
+--CREDITS--
+Christian Wenz <wenz@php.net>
+--SKIPIF--
+<?php
+  if (!extension_loaded('tidy')) die ('skip tidy not present');
+?>
+--FILE--
+<?php
+$buffer = '<html></html>';
+$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"