Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DocBook 5.2 class and exception markup migration #134

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add tests comparing old and new markup rendering output
haszi committed Jun 3, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit d390274ad3a19e34eb391b49e3579df1cf0072a3
35 changes: 35 additions & 0 deletions tests/package/php/class_rendering_003.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
--TEST--
Class rendering 003 - compare output of phpdoc:classref and reference element with role="class" rendering
--FILE--
<?php
namespace phpdotnet\phd;

require_once __DIR__ . "/../../setup.php";

$xml_filePhpdoc = __DIR__ . "/data/class_rendering_001.xml";

Config::init(["xml_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)
35 changes: 35 additions & 0 deletions tests/package/php/exception_rendering_003.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
--TEST--
Exception rendering 003 - compare output of phpdoc:exceptionref and reference element with role="exception" rendering
--FILE--
<?php
namespace phpdotnet\phd;

require_once __DIR__ . "/../../setup.php";

$xml_filePhpdoc = __DIR__ . "/data/exception_rendering_001.xml";

Config::init(["xml_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)