Skip to content

Commit

Permalink
Add tests comparing old and new markup rendering output
Browse files Browse the repository at this point in the history
  • Loading branch information
haszi committed Jun 3, 2024
1 parent d412ea7 commit d390274
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
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)

0 comments on commit d390274

Please sign in to comment.