From e4a363fde2366abc680c40c11d18f1e2a6c46da8 Mon Sep 17 00:00:00 2001 From: haszi Date: Wed, 7 Feb 2024 19:48:35 +0100 Subject: [PATCH] Fix tests (#91) Co-authored-by: haszi --- phpdotnet/phd/Package/Generic/XHTML.php | 5 +- phpdotnet/phd/Package/PHP/XHTML.php | 4 +- tests/php/TestChunkedXHTML.php | 4 + tests/php/bug49101-1.phpt | 6 +- tests/php/bug49101-2.phpt | 6 +- tests/php/bug49102-1.phpt | 75 +-- tests/php/faq001.phpt | 6 +- tests/setup.php | 27 +- tests/xhtml/001.phpt | 208 ++---- tests/xhtml/002.phpt | 648 ++++++------------- tests/xhtml/003.phpt | 822 +++++++++--------------- tests/xhtml/TestChunkedXHTML.php | 39 ++ 12 files changed, 654 insertions(+), 1196 deletions(-) create mode 100644 tests/xhtml/TestChunkedXHTML.php diff --git a/phpdotnet/phd/Package/Generic/XHTML.php b/phpdotnet/phd/Package/Generic/XHTML.php index fe409e87f..963e85c5a 100644 --- a/phpdotnet/phd/Package/Generic/XHTML.php +++ b/phpdotnet/phd/Package/Generic/XHTML.php @@ -1,6 +1,7 @@ 'div', /* Docbook-xsl prints "abstract"... */ @@ -794,7 +795,7 @@ public function format_container_chunk_top($open, $name, $attrs, $props) { $this->CURRENT_CHUNK = $id; $this->notify(Render::CHUNK, Render::CLOSE); $toc = ""; - if (!in_array($id, $this->TOC_WRITTEN)) { + if (!in_array($id, $this->TOC_WRITTEN ?? [])) { $toc = $this->createTOC($id, $name, $props); } @@ -832,7 +833,7 @@ public function format_container_chunk_below($open, $name, $attrs, $props) { $toc = '
    '; $desc = ""; - if (!in_array($id, $this->TOC_WRITTEN)) { + if (!in_array($id, $this->TOC_WRITTEN ?? [])) { $toc = $this->createTOC($id, $name, $props); } $toc .= "
\n"; diff --git a/phpdotnet/phd/Package/PHP/XHTML.php b/phpdotnet/phd/Package/PHP/XHTML.php index e7188b26b..c5da19cb4 100644 --- a/phpdotnet/phd/Package/PHP/XHTML.php +++ b/phpdotnet/phd/Package/PHP/XHTML.php @@ -766,7 +766,7 @@ private function isChunkedByAttributes(array $attributes): bool { } public function format_container_chunk($open, $name, $attrs, $props) { - $this->CURRENT_CHUNK = $this->CURRENT_ID = $id = $attrs[Reader::XMLNS_XML]["id"]; + $this->CURRENT_CHUNK = $this->CURRENT_ID = $id = $attrs[Reader::XMLNS_XML]["id"] ?? ''; if ($this->isChunkedByAttributes($attrs)) { $this->cchunk = $this->dchunk; @@ -809,7 +809,7 @@ public function format_container_chunk($open, $name, $attrs, $props) { } public function format_root_chunk($open, $name, $attrs) { - $this->CURRENT_CHUNK = $this->CURRENT_ID = $id = $attrs[Reader::XMLNS_XML]["id"]; + $this->CURRENT_CHUNK = $this->CURRENT_ID = $id = $attrs[Reader::XMLNS_XML]["id"] ?? ''; if ($open) { $this->notify(Render::CHUNK, Render::OPEN); return '
'; diff --git a/tests/php/TestChunkedXHTML.php b/tests/php/TestChunkedXHTML.php index b5c190251..c10a1e7d8 100644 --- a/tests/php/TestChunkedXHTML.php +++ b/tests/php/TestChunkedXHTML.php @@ -24,6 +24,10 @@ public function writeChunk($id, $fp) { $content = "\n"; $content .= stream_get_contents($fp); + if ($id === "") { + $filename = Config::xml_file(); + } + echo "Filename: " . basename($filename) . "\n"; echo "Content:" . $content . "\n"; } diff --git a/tests/php/bug49101-1.phpt b/tests/php/bug49101-1.phpt index a963e39ba..d1f3644d3 100644 --- a/tests/php/bug49101-1.phpt +++ b/tests/php/bug49101-1.phpt @@ -5,7 +5,6 @@ Bug #49101 - Thick border again namespace phpdotnet\phd; require_once __DIR__ . "/../setup.php"; -require_once __DIR__ . "/../TestRender.php"; require_once __DIR__ . "/TestChunkedXHTML.php"; $formatclass = "TestChunkedXHTML"; @@ -25,6 +24,11 @@ $extra = array( ); $render = new TestRender($formatclass, $opts, $extra); + +if (Index::requireIndexing() && !file_exists($opts["output_dir"])) { + mkdir($opts["output_dir"], 0755); +} + $render->run(); ?> --EXPECT-- diff --git a/tests/php/bug49101-2.phpt b/tests/php/bug49101-2.phpt index 8f03faa83..6d04d116d 100644 --- a/tests/php/bug49101-2.phpt +++ b/tests/php/bug49101-2.phpt @@ -5,7 +5,6 @@ Bug #49101 - Thick border again - Big XHTML namespace phpdotnet\phd; require_once __DIR__ . "/../setup.php"; -require_once __DIR__ . "/../TestRender.php"; require_once __DIR__ . "/TestBigXHTML.php"; $formatclass = "TestBigXHTML"; @@ -25,6 +24,11 @@ $extra = array( ); $render = new TestRender($formatclass, $opts, $extra); + +if (Index::requireIndexing() && !file_exists($opts["output_dir"])) { + mkdir($opts["output_dir"], 0755); +} + $render->run(); ?> --EXPECTF-- diff --git a/tests/php/bug49102-1.phpt b/tests/php/bug49102-1.phpt index b8f657cf1..d3f0f0ffe 100644 --- a/tests/php/bug49102-1.phpt +++ b/tests/php/bug49102-1.phpt @@ -5,7 +5,6 @@ Bug #49102 - Class reference pages don't normalize the methodnames in PhD trunk/ namespace phpdotnet\phd; require_once __DIR__ . "/../setup.php"; -require_once __DIR__ . "/../TestRender.php"; require_once __DIR__ . "/TestChunkedXHTML.php"; $formatclass = "TestChunkedXHTML"; @@ -26,6 +25,11 @@ $extra = array( ); $test = new TestRender($formatclass, $opts, $extra); + +if (Index::requireIndexing() && !file_exists($opts["output_dir"])) { + mkdir($opts["output_dir"], 0755); +} + $test->run(); ?> @@ -42,73 +46,40 @@ Content:

Class synopsis

-
+
- SplStack + class SplStack extends - SplDoublyLinkedList - - - implements - Iterator - - - , - ArrayAccess + SplDoublyLinkedList - , - Countable - - {
+ implements + Iterator, ArrayAccess, Countable {
/* Methods */
- __construct - ( void - )
+ __construct()
-
- void setIteratorMode - ( int $mode - )
+
setIteratorMode(int $mode): void
/* Inherited methods */
-
- mixed SplDoublyLinkedList::bottom - ( void - )
- -
- int SplDoublyLinkedList::count - ( void - )
- -
- mixed SplDoublyLinkedList::current - ( void - )
- -
- int SplDoublyLinkedList::getIteratorMode - ( void - )
- -
- bool SplDoublyLinkedList::offsetExists - ( mixed $index - )
- -
- mixed SplDoublyLinkedList::offsetGet - ( mixed $index - )
+
SplDoublyLinkedList::bottom(): mixed
+ +
SplDoublyLinkedList::count(): int
+ +
SplDoublyLinkedList::current(): mixed
+ +
SplDoublyLinkedList::getIteratorMode(): int
+ +
SplDoublyLinkedList::offsetExists(mixed $index): bool
+ +
SplDoublyLinkedList::offsetGet(mixed $index): mixed
} diff --git a/tests/php/faq001.phpt b/tests/php/faq001.phpt index ae9de799c..f05f444b2 100644 --- a/tests/php/faq001.phpt +++ b/tests/php/faq001.phpt @@ -5,7 +5,6 @@ Testing a simple FAQ namespace phpdotnet\phd; require_once __DIR__ . "/../setup.php"; -require_once __DIR__ . "/../TestRender.php"; require_once __DIR__ . "/TestChunkedXHTML.php"; $formatclass = "TestChunkedXHTML"; @@ -25,6 +24,11 @@ $extra = array( ); $render = new TestRender($formatclass, $opts, $extra); + +if (Index::requireIndexing() && !file_exists($opts["output_dir"])) { + mkdir($opts["output_dir"], 0755); +} + $render->run(); ?> --EXPECT-- diff --git a/tests/setup.php b/tests/setup.php index ec946228f..78d0bd6df 100644 --- a/tests/setup.php +++ b/tests/setup.php @@ -1,19 +1,24 @@ __PHDDIR__ . DIRECTORY_SEPARATOR . "phpdotnet" . DIRECTORY_SEPARATOR + . "phd" . DIRECTORY_SEPARATOR . "data" . DIRECTORY_SEPARATOR + . "langs" . DIRECTORY_SEPARATOR, + "phpweb_version_filename" => Config::xml_root() . DIRECTORY_SEPARATOR . 'version.xml', + "phpweb_acronym_filename" => Config::xml_root() . DIRECTORY_SEPARATOR . 'entities' . DIRECTORY_SEPARATOR . 'acronyms.xml', + "phpweb_sources_filename" => Config::xml_root() . DIRECTORY_SEPARATOR . 'sources.xml', + "package_dirs" => [__PHDDIR__, __INSTALLDIR__], +]); /* * vim600: sw=4 ts=4 syntax=php et diff --git a/tests/xhtml/001.phpt b/tests/xhtml/001.phpt index d91227d00..17700b9e1 100644 --- a/tests/xhtml/001.phpt +++ b/tests/xhtml/001.phpt @@ -2,167 +2,93 @@ CALS Table rendering --FILE-- getMap(); - -while($reader->read()) { - $type = $reader->nodeType; - $name = $reader->name; - - switch($type) { - case XMLReader::ELEMENT: - case XMLReader::END_ELEMENT: - $open = $type == XMLReader::ELEMENT; - - $funcname = "format_$name"; - if (isset($map[$name])) { - $tag = $map[$name]; - if (is_array($tag)) { - $tag = $reader->notXPath($tag); - } - if (strncmp($tag, "format_", 7)) { - $retval = $format->transformFromMap($open, $tag, $name); - break; - } - $funcname = $tag; - } - - $retval = $format->{$funcname}($open, $name); - break; - - case XMLReader::TEXT: - $retval = htmlspecialchars($reader->value, ENT_QUOTES); - break; - - case XMLReader::CDATA: - $retval = $format->CDATA($reader->value); - break; - - case XMLReader::COMMENT: - case XMLReader::WHITESPACE: - case XMLReader::SIGNIFICANT_WHITESPACE: - case XMLReader::DOC_TYPE: - /* swallow it */ - continue 2; - - default: - trigger_error("Don't know how to handle {$name} {$type}", E_USER_ERROR); - return; - } - echo $retval, "\n"; +require_once __DIR__ . "/../setup.php"; +require_once __DIR__ . "/TestChunkedXHTML.php"; + +$formatclass = "TestChunkedXHTML"; +$xml_file = __DIR__ . "/data/001-1.xml"; + +$opts = array( + "index" => true, + "xml_root" => dirname($xml_file), + "xml_file" => $xml_file, + "output_dir" => __DIR__ . "/output/", +); + +$extra = array( + "lang_dir" => __PHDDIR__ . "phpdotnet/phd/data/langs/", + "phpweb_version_filename" => dirname($xml_file) . '/version.xml', + "phpweb_acronym_filename" => dirname($xml_file) . '/acronyms.xml', +); + +$render = new TestRender($formatclass, $opts, $extra); + +if (Index::requireIndexing() && !file_exists($opts["output_dir"])) { + mkdir($opts["output_dir"], 0755); } -$reader->close(); +$render->run(); ?> ---EXPECT-- -
-

-Example table -

- -

-Sample CALS Table -

-- ----- - - - - - +--EXPECTF-- +Filename: %s.html +Content: +
+

Example table

+ +
-Horizontal Span - -a3 - -a4 - -a5 -
+ + +++++ + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - + + + + - - - - + + + + -
Sample CALS Table
Horizontal Spana3a4a5
-f1 - -f2 - -f3 - -f4 - -f5 -
f1f2f3f4f5
-b1 - -b2 - -b3 - -b4 - -

-Vertical Span -

-
b1b2b3b4

Vertical Span

-c1 - -Span Both - -c4 -
c1Span Bothc4
-d1 - -d4 - -d5 -
d1d4d5
+
diff --git a/tests/xhtml/002.phpt b/tests/xhtml/002.phpt index ae46da529..9483f1abb 100644 --- a/tests/xhtml/002.phpt +++ b/tests/xhtml/002.phpt @@ -2,470 +2,210 @@ CALS Table rendering#002 --FILE-- getMap(); +$opts = array( + "index" => true, + "xml_root" => dirname($xml_file), + "xml_file" => $xml_file, + "output_dir" => __DIR__ . "/output/", +); -while($reader->read()) { - $type = $reader->nodeType; - $name = $reader->name; +$extra = array( + "lang_dir" => __PHDDIR__ . "phpdotnet/phd/data/langs/", + "phpweb_version_filename" => dirname($xml_file) . '/version.xml', + "phpweb_acronym_filename" => dirname($xml_file) . '/acronyms.xml', +); - switch($type) { - case XMLReader::ELEMENT: - case XMLReader::END_ELEMENT: - $open = $type == XMLReader::ELEMENT; +$render = new TestRender($formatclass, $opts, $extra); - $funcname = "format_$name"; - if (isset($map[$name])) { - $tag = $map[$name]; - if (is_array($tag)) { - $tag = $reader->notXPath($tag); - } - if (strncmp($tag, "format_", 7)) { - $retval = $format->transformFromMap($open, $tag, $name); - break; - } - $funcname = $tag; - } - - $retval = $format->{$funcname}($open, $name); - break; - - case XMLReader::TEXT: - $retval = htmlspecialchars($reader->value, ENT_QUOTES); - break; - - case XMLReader::CDATA: - $retval = $format->CDATA($reader->value); - break; - - case XMLReader::COMMENT: - case XMLReader::WHITESPACE: - case XMLReader::SIGNIFICANT_WHITESPACE: - case XMLReader::DOC_TYPE: - /* swallow it */ - continue 2; - - default: - trigger_error("Don't know how to handle {$name} {$type}", E_USER_ERROR); - return; - } - echo $retval, "\n"; +if (Index::requireIndexing() && !file_exists($opts["output_dir"])) { + mkdir($opts["output_dir"], 0755); } -$reader->close(); +$render->run(); ?> --EXPECT-- +Filename: function.db2-set-option.html +Content:
- -

-Resource-Parameter Matrix -

-- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Key - -Value - -Resource Type -
   -Connection - -Statement - -Result Set -
-autocommit - - -DB2_AUTOCOMMIT_ON - - -X - -- - -- -
-autocommit - - -DB2_AUTOCOMMIT_OFF - - -X - -- - -- -
-cursor - - -DB2_SCROLLABLE - - -- - -X - -- -
-cursor - - -DB2_FORWARD_ONLY - - -- - -X - -- -
-binmode - - -DB2_BINARY - - -X - -X - -- -
-binmode - - -DB2_CONVERT - - -X - -X - -- -
-binmode - - -DB2_PASSTHRU - - -X - -X - -- -
-db2_attr_case - - -DB2_CASE_LOWER - - -X - -X - -- -
-db2_attr_case - - -DB2_CASE_UPPER - - -X - -X - -- -
-db2_attr_case - - -DB2_CASE_NATURAL - - -X - -X - -- -
-deferred_prepare - - -DB2_DEFERRED_PREPARE_ON - - -- - -X - -- -
-deferred_prepare - - -DB2_DEFERRED_PREPARE_OFF - - -- - -X - -- -
-i5_fetch_only - - -DB2_I5_FETCH_ON - - -- - -X - -- -
-i5_fetch_only - - -DB2_I5_FETCH_OFF - - -- - -X - -- -
-userid - - -SQL_ATTR_INFO_USERID - - -X - -X - -- -
-acctstr - - -SQL_ATTR_INFO_ACCTSTR - - -X - -X - -- -
-applname - - -SQL_ATTR_INFO_APPLNAME - - -X - -X - -- -
-wrkstnname - - -SQL_ATTR_INFO_WRKSTNNAME - - -X - -X - -- -
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Resource-Parameter Matrix
KeyValueResource Type
  ConnectionStatementResult Set
autocommitDB2_AUTOCOMMIT_ONX--
autocommitDB2_AUTOCOMMIT_OFFX--
cursorDB2_SCROLLABLE-X-
cursorDB2_FORWARD_ONLY-X-
binmodeDB2_BINARYXX-
binmodeDB2_CONVERTXX-
binmodeDB2_PASSTHRUXX-
db2_attr_caseDB2_CASE_LOWERXX-
db2_attr_caseDB2_CASE_UPPERXX-
db2_attr_caseDB2_CASE_NATURALXX-
deferred_prepareDB2_DEFERRED_PREPARE_ON-X-
deferred_prepareDB2_DEFERRED_PREPARE_OFF-X-
i5_fetch_onlyDB2_I5_FETCH_ON-X-
i5_fetch_onlyDB2_I5_FETCH_OFF-X-
useridSQL_ATTR_INFO_USERIDXX-
acctstrSQL_ATTR_INFO_ACCTSTRXX-
applnameSQL_ATTR_INFO_APPLNAMEXX-
wrkstnnameSQL_ATTR_INFO_WRKSTNNAMEXX-
- diff --git a/tests/xhtml/003.phpt b/tests/xhtml/003.phpt index ce65a28cc..becab0328 100644 --- a/tests/xhtml/003.phpt +++ b/tests/xhtml/003.phpt @@ -2,547 +2,307 @@ CALS Table rendering#003 --FILE-- getMap(); - -while($reader->read()) { - $type = $reader->nodeType; - $name = $reader->name; - - switch($type) { - case XMLReader::ELEMENT: - case XMLReader::END_ELEMENT: - $open = $type == XMLReader::ELEMENT; - - $funcname = "format_$name"; - if (isset($map[$name])) { - $tag = $map[$name]; - if (is_array($tag)) { - $tag = $reader->notXPath($tag); - } - if (strncmp($tag, "format_", 7)) { - $retval = $format->transformFromMap($open, $tag, $name); - break; - } - $funcname = $tag; - } - - $retval = $format->{$funcname}($open, $name); - break; - - case XMLReader::TEXT: - $retval = htmlspecialchars($reader->value, ENT_QUOTES); - break; - - case XMLReader::CDATA: - $retval = $format->CDATA($reader->value); - break; - - case XMLReader::COMMENT: - case XMLReader::WHITESPACE: - case XMLReader::SIGNIFICANT_WHITESPACE: - case XMLReader::DOC_TYPE: - /* swallow it */ - continue 2; - - default: - trigger_error("Don't know how to handle {$name} {$type}", E_USER_ERROR); - return; - } - echo $retval, "\n"; +require_once __DIR__ . "/../setup.php"; +require_once __DIR__ . "/TestChunkedXHTML.php"; + +$formatclass = "TestChunkedXHTML"; +$xml_file = __DIR__ . "/data/003.xml"; + +$opts = array( + "index" => true, + "xml_root" => dirname($xml_file), + "xml_file" => $xml_file, + "output_dir" => __DIR__ . "/output/", +); + +$extra = array( + "lang_dir" => __PHDDIR__ . "phpdotnet/phd/data/langs/", + "phpweb_version_filename" => dirname($xml_file) . '/version.xml', + "phpweb_acronym_filename" => dirname($xml_file) . '/acronyms.xml', +); + +$render = new TestRender($formatclass, $opts, $extra); + +if (Index::requireIndexing() && !file_exists($opts["output_dir"])) { + mkdir($opts["output_dir"], 0755); } -$reader->close(); +$render->run(); ?> --EXPECT-- +Filename: function.nl-langinfo.html +Content:
- -

-nl_langinfo Constants -

-- --- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
-Constant - -Description -
- -LC_TIME Category Constants - -
-ABDAY_(1-7) - -Abbreviated name of n-th day of the week. -
-DAY_(1-7) - -Name of the n-th day of the week (DAY_1 = Sunday). -
-ABMON_(1-12) - -Abbreviated name of the n-th month of the year. -
-MON_(1-12) - -Name of the n-th month of the year. -
-AM_STR - -String for Ante meridian. -
-PM_STR - -String for Post meridian. -
-D_T_FMT - -String that can be used as the format string for -strftime - to represent time and date. -
-D_FMT - -String that can be used as the format string for -strftime - to represent date. -
-T_FMT - -String that can be used as the format string for -strftime - to represent time. -
-T_FMT_AMPM - -String that can be used as the format string for -strftime - to represent time in 12-hour format with ante/post meridian. -
-ERA - -Alternate era. -
-ERA_YEAR - -Year in alternate era format. -
-ERA_D_T_FMT - -Date and time in alternate era format (string can be used in -strftime -). -
-ERA_D_FMT - -Date in alternate era format (string can be used in -strftime -). -
-ERA_T_FMT - -Time in alternate era format (string can be used in -strftime -). -
- -LC_MONETARY Category Constants - -
-INT_CURR_SYMBOL - -International currency symbol. -
-CURRENCY_SYMBOL - -Local currency symbol. -
-CRNCYSTR - -Same value as CURRENCY_SYMBOL. -
-MON_DECIMAL_POINT - -Decimal point character. -
-MON_THOUSANDS_SEP - -Thousands separator (groups of three digits). -
-MON_GROUPING - -Like 'grouping' element. -
-POSITIVE_SIGN - -Sign for positive values. -
-NEGATIVE_SIGN - -Sign for negative values. -
-INT_FRAC_DIGITS - -International fractional digits. -
-FRAC_DIGITS - -Local fractional digits. -
-P_CS_PRECEDES - -Returns 1 if CURRENCY_SYMBOL precedes a positive value. -
-P_SEP_BY_SPACE - -Returns 1 if a space separates CURRENCY_SYMBOL from a positive value. -
-N_CS_PRECEDES - -Returns 1 if CURRENCY_SYMBOL precedes a negative value. -
-N_SEP_BY_SPACE - -Returns 1 if a space separates CURRENCY_SYMBOL from a negative value. -
-P_SIGN_POSN - -
    -
  • -

    - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    nl_langinfo Constants
    ConstantDescription
    LC_TIME Category Constants
    ABDAY_(1-7)Abbreviated name of n-th day of the week.
    DAY_(1-7)Name of the n-th day of the week (DAY_1 = Sunday).
    ABMON_(1-12)Abbreviated name of the n-th month of the year.
    MON_(1-12)Name of the n-th month of the year.
    AM_STRString for Ante meridian.
    PM_STRString for Post meridian.
    D_T_FMTString that can be used as the format string for strftime to represent time and date.
    D_FMTString that can be used as the format string for strftime to represent date.
    T_FMTString that can be used as the format string for strftime to represent time.
    T_FMT_AMPMString that can be used as the format string for strftime to represent time in 12-hour format with ante/post meridian.
    ERAAlternate era.
    ERA_YEARYear in alternate era format.
    ERA_D_T_FMTDate and time in alternate era format (string can be used in strftime).
    ERA_D_FMTDate in alternate era format (string can be used in strftime).
    ERA_T_FMTTime in alternate era format (string can be used in strftime).
    LC_MONETARY Category Constants
    INT_CURR_SYMBOLInternational currency symbol.
    CURRENCY_SYMBOLLocal currency symbol.
    CRNCYSTRSame value as CURRENCY_SYMBOL.
    MON_DECIMAL_POINTDecimal point character.
    MON_THOUSANDS_SEPThousands separator (groups of three digits).
    MON_GROUPINGLike 'grouping' element.
    POSITIVE_SIGNSign for positive values.
    NEGATIVE_SIGNSign for negative values.
    INT_FRAC_DIGITSInternational fractional digits.
    FRAC_DIGITSLocal fractional digits.
    P_CS_PRECEDESReturns 1 if CURRENCY_SYMBOL precedes a positive value.
    P_SEP_BY_SPACEReturns 1 if a space separates CURRENCY_SYMBOL from a positive value.
    N_CS_PRECEDESReturns 1 if CURRENCY_SYMBOL precedes a negative value.
    N_SEP_BY_SPACEReturns 1 if a space separates CURRENCY_SYMBOL from a negative value.
    P_SIGN_POSN +
      +
    • + Returns 0 if parentheses surround the quantity and currency_symbol. - -

      -
    • -
    • -

      - + +

    • +
    • + Returns 1 if the sign string precedes the quantity and currency_symbol. - -

      -
    • -
    • -

      - + +

    • +
    • + Returns 2 if the sign string follows the quantity and currency_symbol. - -

      -
    • -
    • -

      - + +

    • +
    • + Returns 3 if the sign string immediately precedes the currency_symbol. - -

      -
    • -
    • -

      - + +

    • +
    • + Returns 4 if the sign string immediately follows the currency_symbol. - -

      -
    • -
    -
    -N_SIGN_POSN -
    - -LC_NUMERIC Category Constants - -
    -DECIMAL_POINT - -Decimal point character. -
    -RADIXCHAR - -Same value as DECIMAL_POINT. -
    -THOUSANDS_SEP - -Separator character for thousands (groups of three digits). -
    -THOUSEP - -Same value as THOUSANDS_SEP. -
    -GROUPING - -
    - -LC_MESSAGES Category Constants - -
    -YESEXPR - -Regex string for matching 'yes' input. -
    -NOEXPR - -Regex string for matching 'no' input. -
    -YESSTR - -Output string for 'yes'. -
    -NOSTR - -Output string for 'no'. -
    - -LC_CTYPE Category Constants - -
    -CODESET - -Return a string with the name of the character encoding. -
    + +

  • +
+
N_SIGN_POSN
LC_NUMERIC Category Constants
DECIMAL_POINTDecimal point character.
RADIXCHARSame value as DECIMAL_POINT.
THOUSANDS_SEPSeparator character for thousands (groups of three digits).
THOUSEPSame value as THOUSANDS_SEP.
GROUPING
LC_MESSAGES Category Constants
YESEXPRRegex string for matching 'yes' input.
NOEXPRRegex string for matching 'no' input.
YESSTROutput string for 'yes'.
NOSTROutput string for 'no'.
LC_CTYPE Category Constants
CODESETReturn a string with the name of the character encoding.
- diff --git a/tests/xhtml/TestChunkedXHTML.php b/tests/xhtml/TestChunkedXHTML.php new file mode 100644 index 000000000..b41ba74a4 --- /dev/null +++ b/tests/xhtml/TestChunkedXHTML.php @@ -0,0 +1,39 @@ +setOutputDir(Config::output_dir() . strtolower($this->getFormatName()) . '/'); + break; + //No verbose + } + } + + public function writeChunk($id, $fp) { + $filename = $this->getOutputDir() . $id . $this->getExt(); + + rewind($fp); + $content = "\n"; + $content .= stream_get_contents($fp); + + if ($id === "") { + $filename = Config::xml_file(); + } + + echo "Filename: " . basename($filename) . "\n"; + echo "Content:" . $content . "\n"; + } +} + +/* +* vim600: sw=4 ts=4 syntax=php et +* vim<600: sw=4 ts=4 +*/