From d390274ad3a19e34eb391b49e3579df1cf0072a3 Mon Sep 17 00:00:00 2001 From: haszi Date: Mon, 3 Jun 2024 22:42:26 +0200 Subject: [PATCH] Add tests comparing old and new markup rendering output --- tests/package/php/class_rendering_003.phpt | 35 +++++++++++++++++++ .../package/php/exception_rendering_003.phpt | 35 +++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 tests/package/php/class_rendering_003.phpt create mode 100644 tests/package/php/exception_rendering_003.phpt diff --git a/tests/package/php/class_rendering_003.phpt b/tests/package/php/class_rendering_003.phpt new file mode 100644 index 00000000..d378c1f3 --- /dev/null +++ b/tests/package/php/class_rendering_003.phpt @@ -0,0 +1,35 @@ +--TEST-- +Class rendering 003 - compare output of phpdoc:classref and reference element with role="class" rendering +--FILE-- + $xml_filePhpdoc]); + +$formatPhpdoc = new TestPHPChunkedXHTML; +$renderPhpdoc = new TestRender(new Reader, new Config, $formatPhpdoc); + +ob_start(); +$renderPhpdoc->run(); +$phpdocOutput = ob_get_clean(); + + +$xml_fileReferenceWithRole = __DIR__ . "/data/class_rendering_002.xml"; + +Config::init(["xml_file" => $xml_fileReferenceWithRole]); + +$formatReferenceWithRole = new TestPHPChunkedXHTML; +$renderReferenceWithRole = new TestRender(new Reader, new Config, $formatReferenceWithRole); + +ob_start(); +$renderReferenceWithRole->run(); +$referenceWithRoleOutput = ob_get_clean(); + +var_dump($phpdocOutput === $referenceWithRoleOutput); +?> +--EXPECT-- +bool(true) diff --git a/tests/package/php/exception_rendering_003.phpt b/tests/package/php/exception_rendering_003.phpt new file mode 100644 index 00000000..e7a61ca0 --- /dev/null +++ b/tests/package/php/exception_rendering_003.phpt @@ -0,0 +1,35 @@ +--TEST-- +Exception rendering 003 - compare output of phpdoc:exceptionref and reference element with role="exception" rendering +--FILE-- + $xml_filePhpdoc]); + +$formatPhpdoc = new TestPHPChunkedXHTML; +$renderPhpdoc = new TestRender(new Reader, new Config, $formatPhpdoc); + +ob_start(); +$renderPhpdoc->run(); +$phpdocOutput = ob_get_clean(); + + +$xml_fileReferenceWithRole = __DIR__ . "/data/exception_rendering_002.xml"; + +Config::init(["xml_file" => $xml_fileReferenceWithRole]); + +$formatReferenceWithRole = new TestPHPChunkedXHTML; +$renderReferenceWithRole = new TestRender(new Reader, new Config, $formatReferenceWithRole); + +ob_start(); +$renderReferenceWithRole->run(); +$referenceWithRoleOutput = ob_get_clean(); + +var_dump($phpdocOutput === $referenceWithRoleOutput); +?> +--EXPECT-- +bool(true)